/* Reusable component styles. Layout/shell-specific rules live in app.css. */

* { box-sizing: border-box; }

/* ---------- typography helpers ---------- */
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-mono { font-family: var(--font-mono); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; overflow-wrap: anywhere; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }
.text-xs { font-size: var(--text-xs); line-height: 1.5; }
.text-sm, .sub { font-size: var(--text-sm); line-height: 1.5; }
.sub { color: var(--text-secondary); overflow-wrap: anywhere; }
.page-stack > p { margin: 0; }
.actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; min-width: 0; }
.actions > .btn { flex: 0 1 auto; }
.notification-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.notification-deliveries { list-style: none; margin: 0; padding: var(--sp-3) 0 0; display: grid; gap: var(--sp-3); border-top: 1px solid var(--border); }
.notification-deliveries li { min-width: 0; display: grid; gap: var(--sp-1); }
.notification-deliveries p { margin: 0; }
@media (max-width: 600px) { .notification-settings-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
  white-space: normal; line-height: 1.35; max-width: 100%; min-height: 34px; text-align: center;
}
.btn:hover { background: var(--surface-3); border-color: var(--text-tertiary); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; display: block; }
td > .btn + .btn { margin-inline-start: var(--sp-1); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--text-on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { padding: 5px 10px; font-size: var(--text-xs); min-height: 28px; }
.btn-lg { padding: 11px 20px; font-size: var(--text-base); }
.btn-icon { padding: 8px; width: 34px; height: 34px; }
.btn-block { width: 100%; }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; line-height: 1.45; }
.field-label { font-size: var(--text-sm); font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.field-hint { font-size: var(--text-xs); color: var(--text-tertiary); overflow-wrap: anywhere; line-height: 1.45; }
.field-error { font-size: var(--text-xs); color: var(--danger); }
.input, .select, .textarea {
  font-family: var(--font-sans); font-size: var(--text-base); color: var(--text);
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); width: 100%; min-width: 0; line-height: 1.45; transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.textarea { resize: vertical; min-height: 90px; font-family: var(--font-sans); }
.input-sm { padding: 6px 10px; font-size: var(--text-sm); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: var(--text-base); }

/* ---------- cards / surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: var(--text-md); }
.card-header .sub { font-size: var(--text-sm); color: var(--text-tertiary); margin-top: 2px; }
.card-body { padding: 14px; }

/* ---------- stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px; box-shadow: var(--shadow-sm); }
.stat-card .icon-badge { width: 24px; height: 24px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; background: var(--surface-3); color: var(--text-secondary); }
.stat-card.ok .icon-badge { background: var(--success-soft); color: var(--success); }
.stat-card.err .icon-badge { background: var(--danger-soft); color: var(--danger); }
.stat-card.warn .icon-badge { background: var(--warning-soft); color: var(--warning); }
.stat-card .label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 600; overflow-wrap: anywhere; }
.stat-card .value { font-size: clamp(var(--text-lg), 2vw, var(--text-3xl)); font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; line-height: 1.15; overflow-wrap: anywhere; }
.stat-card .delta { font-size: var(--text-xs); font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-card .delta.up { color: var(--success); }
.stat-card .delta.down { color: var(--danger); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; max-width: 100%; container-type: inline-size; }
.card:has(> table) { container-type: inline-size; }
/* Keep data readable on phones: scroll the table inside its own surface,
   rather than squeezing names and action labels into one-letter columns. */
:is(.table-wrap, .card) > table:not(.sh-table) td { min-width: 96px; }
:is(.table-wrap, .card) > table:not(.sh-table) td:first-child { min-width: 144px; }
:is(.table-wrap, .card) > table:not(.sh-table):has(> thead > tr > :nth-child(5)) { min-width: 760px; }
:is(.table-wrap, .card) > table:not(.sh-table):has(> thead > tr > :nth-child(8)) { min-width: 1040px; }
/* An empty result belongs to the visible scroller, not the full wide table. */
:is(.table-wrap, .card) > table td[colspan]:has(> .empty-state) { padding-inline: 0; }
:is(.table-wrap, .card) > table td[colspan] > .empty-state { width: 100cqw; max-width: 100%; position: sticky; left: 0; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
th {
  text-align: left; color: var(--text-tertiary); font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--surface-2);
}
td { padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--text); white-space: normal; overflow-wrap: anywhere; }
td.num, td.nowrap, td .badge, td.text-mono { white-space: nowrap; overflow-wrap: normal; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--duration-fast); cursor: default; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
td.wrap { white-space: normal; }
td.wrap-anywhere { white-space: normal; overflow-wrap: anywhere; min-width: 160px; max-width: 320px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

/* ---------- responsive operational telemetry ---------- */
.system-sections, .system-list { display: grid; gap: 12px; }
.system-section { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.system-section > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; cursor:pointer; font-weight:700; background:var(--surface-2); }
.system-section > .system-list { padding: 12px; }
.system-row { border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); min-width:0; overflow:hidden; }
.system-row-main { display:grid; grid-template-columns:minmax(240px,2fr) repeat(4,minmax(120px,1fr)); gap:14px; align-items:start; padding:14px 16px; }
.system-primary { min-width:0; display:grid; gap:4px; }
.system-primary strong { overflow-wrap:anywhere; }
.system-primary span, .system-label { color:var(--text-tertiary); font-size:var(--text-xs); }
.system-label { display:block; margin-bottom:4px; text-transform:uppercase; letter-spacing:.04em; }
.system-row-detail { border-top:1px solid var(--border); }
.system-row-detail > summary { cursor:pointer; padding:10px 16px; color:var(--text-secondary); font-size:var(--text-sm); }
.system-detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; padding:0 16px 14px; margin:0; }
.system-detail-grid div { min-width:0; }
.system-detail-grid dt { color:var(--text-tertiary); font-size:var(--text-xs); }
.system-detail-grid dd { margin:4px 0 0; overflow-wrap:anywhere; }
.system-detail-grid small { display:block; color:var(--text-tertiary); }
.system-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.system-summary .card { padding:16px; display:grid; gap:4px; }
.system-summary strong { font-size:var(--text-lg); }
.system-summary span { color:var(--text-secondary); }
.system-wide-card { grid-column:1 / -1; min-width:0; }
.system-pool-summary { display:flex; flex-wrap:wrap; gap:8px 20px; padding:0 16px 14px; color:var(--text-secondary); }
.system-pool-summary strong { color:var(--text-primary); font-variant-numeric:tabular-nums; }
.system-cell-subtext { display:block; margin-top:2px; color:var(--text-tertiary); font-size:var(--text-xs); overflow-wrap:anywhere; }
.system-empty { padding:20px; color:var(--text-tertiary); text-align:center; }
.system-error { padding:16px; color:var(--danger); }
.log-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:12px 16px; border-bottom:1px solid var(--border); }
.log-toolbar input { min-width:220px; flex:1; }
.log-content { margin:0; padding:12px 16px; max-height:65vh; overflow:auto; font-family:var(--font-mono); font-size:var(--text-sm); line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.log-meta { padding:10px 16px; color:var(--text-tertiary); font-size:var(--text-xs); border-bottom:1px solid var(--border); overflow-wrap:anywhere; }

@media (max-width: 900px) {
  .system-row-main, .service-row-main { grid-template-columns:1fr 1fr; }
  .system-primary { grid-column:1 / -1; }
  .system-summary { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  .system-row-main, .service-row-main { grid-template-columns:1fr; padding:12px; }
  .system-primary { grid-column:auto; }
  .system-section > .system-list { padding:8px; }
  .log-toolbar input { min-width:100%; }
}

/* ---------- System → Server Health (new .sh-* classes only; no shared selector is changed) ---------- */
.sh-page, .sh-page #sh-body { min-width:0; }
.sh-page #sh-body, .sh-content { display:flex; flex-direction:column; gap:20px; }
.sh-updated { display:flex; align-items:center; justify-content:flex-end; gap:6px; flex-wrap:wrap; max-width:100%; font-size:var(--text-sm); overflow-wrap:anywhere; }
.sh-content.is-stale { opacity:.7; }
.sh-banner { padding:12px 16px; border:1px solid var(--warning); border-radius:var(--radius-md); background:var(--warning-soft); color:var(--text); font-size:var(--text-sm); line-height:1.5; overflow-wrap:anywhere; }
.sh-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:12px; }
.sh-summary-card { padding:14px 16px; display:grid; gap:4px; align-content:start; min-width:0; }
.sh-summary-label { color:var(--text-secondary); font-size:var(--text-xs); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.sh-summary-card strong { font-size:var(--text-lg); line-height:1.3; }
.sh-summary-card small { color:var(--text-secondary); font-size:var(--text-sm); line-height:1.45; overflow-wrap:anywhere; }
.sh-section { display:flex; flex-direction:column; gap:12px; min-width:0; }
.sh-section-head h2 { font-size:var(--text-md); }
.sh-section-head p { margin:4px 0 0; color:var(--text-secondary); font-size:var(--text-sm); line-height:1.5; }
.sh-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:16px; align-items:stretch; }
.sh-grid > .sh-wide { grid-column:1 / -1; }
/* Two-card sections use fixed halves so a full-width card below never leaves empty auto-fit tracks. */
.sh-grid.sh-grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.sh-card { display:flex; flex-direction:column; min-width:0; }
.sh-card-danger { border-color:var(--danger); }
.sh-card-head { display:grid; gap:8px; padding:14px 20px; border-bottom:1px solid var(--border); background:var(--surface-2); }
.sh-card-title { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.sh-card-title h3 { font-size:var(--text-base); overflow-wrap:anywhere; }
.sh-scope { display:flex; align-items:flex-start; gap:8px; flex-wrap:wrap; color:var(--text-secondary); font-size:var(--text-sm); line-height:1.45; overflow-wrap:anywhere; }
.sh-scope > span:not(.sh-scope-tag) { flex:1 1 220px; min-width:0; }
.sh-scope .sh-scope-tag { font-family:inherit; }
.sh-scope-tag { display:inline-block; padding:2px 8px; border-radius:var(--radius-full); background:var(--surface-3); color:var(--text-secondary); font-family:var(--font-mono); font-size:var(--text-xs); white-space:nowrap; }
.sh-card-body { padding:16px 20px 20px; display:flex; flex-direction:column; gap:14px; min-width:0; flex:1; }
.sh-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr)); gap:16px 20px; margin:0; }
.sh-metric { min-width:0; }
.sh-metric dt { color:var(--text-secondary); font-size:var(--text-sm); overflow-wrap:anywhere; }
.sh-metric dd { margin:4px 0 0; min-width:0; }
.sh-value { display:block; font-size:var(--text-md); font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.sh-metric small { display:block; margin-top:4px; color:var(--text-secondary); font-size:var(--text-sm); line-height:1.45; overflow-wrap:anywhere; }
.sh-bar { display:flex; align-items:center; gap:8px; margin-top:6px; }
.sh-bar .progress-bar { flex:1; }
.sh-bar span { min-width:34px; text-align:right; color:var(--text-secondary); font-size:var(--text-xs); font-variant-numeric:tabular-nums; }
.sh-note { margin:0; color:var(--text-secondary); font-size:var(--text-sm); line-height:1.5; }
.sh-empty { color:var(--text-secondary); font-size:var(--text-sm); }
.sh-alert { padding:10px 12px; border-radius:var(--radius-sm); background:var(--danger-soft); color:var(--danger-strong); font-size:var(--text-sm); line-height:1.5; overflow-wrap:anywhere; }
.sh-error-list { margin:0; list-style:none; display:grid; gap:4px; }
.sh-pool-summary { display:flex; flex-wrap:wrap; gap:8px 24px; color:var(--text-secondary); font-size:var(--text-sm); }
.sh-pool-summary strong { color:var(--text); font-variant-numeric:tabular-nums; }
.sh-help { margin-top:auto; padding-top:10px; border-top:1px solid var(--border); }
.sh-help > summary { cursor:pointer; color:var(--text-secondary); font-size:var(--text-xs); }
.sh-help dl { display:grid; gap:6px; margin:8px 0 0; }
.sh-help dt { color:var(--text-tertiary); font-size:var(--text-xs); text-transform:uppercase; letter-spacing:.04em; }
.sh-help dd { margin:2px 0 0; color:var(--text-secondary); font-size:var(--text-sm); line-height:1.45; overflow-wrap:anywhere; }
.sh-details > summary { cursor:pointer; padding:4px 0; color:var(--text-secondary); font-size:var(--text-sm); }
.sh-table th { white-space:normal; vertical-align:bottom; }
.sh-table td { vertical-align:top; overflow-wrap:anywhere; }
.sh-findings > summary { cursor:pointer; padding:12px 16px; font-weight:700; background:var(--surface-2); }
.sh-findings ul { list-style:none; margin:0; padding:8px 16px 12px; display:grid; gap:8px; }
.sh-findings li { display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap; font-size:var(--text-sm); line-height:1.45; overflow-wrap:anywhere; }
.sh-findings li > span:last-child { flex:1 1 240px; min-width:0; }
.sh-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; }
@media (max-width: 900px) {
  .sh-grid.sh-grid-2 { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .sh-updated { justify-content:flex-start; }
  .sh-card-head { padding:12px 14px; }
  .sh-card-body { padding:14px; }
}
@media (max-width: 560px) {
  .sh-table thead { display:none; }
  .sh-table, .sh-table tbody, .sh-table tr, .sh-table td { display:block; width:100%; }
  .sh-table tr { padding:10px 0; border-bottom:1px solid var(--border); }
  .sh-table tr:last-child { border-bottom:none; }
  .sh-table td { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:2px 12px; padding:3px 0; border:0; text-align:right; white-space:normal; }
  .sh-table td::before { content:attr(data-label); flex:0 0 42%; color:var(--text-secondary); font-size:var(--text-xs); text-align:left; }
  .sh-table td .system-cell-subtext { flex-basis:100%; text-align:right; }
  .sh-table td.system-empty { display:block; text-align:center; }
  .sh-table td.system-empty::before { content:none; }
}

/* ---------- badges / status pills ---------- */
.badge {
  font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-full);
  background: var(--surface-3); color: var(--text-secondary); display: inline-flex; align-items: center; gap: 5px;
  letter-spacing: .02em; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success-strong); }
.badge-danger { background: var(--danger-soft); color: var(--danger-strong); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-3); color: var(--text-secondary); }

/* ---------- tabs (segmented) ---------- */
.tabbar { display: flex; flex-wrap:wrap; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 20px; }
.tabbar-item {
  font-size: var(--text-sm); font-weight: 600; color: var(--text-tertiary); padding: 13px 4px;
  margin-right: 22px; cursor: pointer; border-bottom: 2px solid transparent; transition: color var(--duration-fast);
  display: flex; align-items: center; gap: 6px; min-width:0; max-width:100%; overflow-wrap:anywhere;
}
.tabbar-item:hover { color: var(--text); }
.tabbar-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabbar-item .count { font-size: 10px; background: var(--surface-3); color: var(--text-secondary); padding: 1px 6px; border-radius: var(--radius-full); }
.tabbar-item.active .count { background: var(--primary-soft); color: var(--primary); }

/* ---------- toolbar (search/filter row) ---------- */
.toolbar { display: flex; align-items: center; gap: var(--sp-2); padding: 10px 14px; flex-wrap: wrap; }
.search-input { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-input svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-tertiary); }
.search-input input { padding-left: 34px; }
.toolbar-spacer { flex: 1; }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap:12px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: var(--text-sm); color: var(--text-secondary); }
.pagination .controls, .pagination-pages { display: flex; align-items:center; gap: 6px; }
.pagination-page { min-width:34px; justify-content:center; }
.pagination-page.active { color:var(--text-on-primary); background:var(--primary); border-color:var(--primary); }
.pagination-ellipsis { min-width:22px; text-align:center; color:var(--text-tertiary); }
@media (max-width: 760px) {
  .pagination { align-items:flex-start; flex-direction:column; }
  .pagination .controls { width:100%; overflow-x:auto; padding-bottom:2px; }
  .pagination-summary { white-space:normal; }
}

/* ---------- empty state ---------- */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-secondary); }
.empty-state .icon { width: 44px; height: 44px; margin: 0 auto 16px; color: var(--text-tertiary); }
.empty-state h3 { font-size: var(--text-md); color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: var(--text-base); margin: 0 0 18px; }

/* ---------- skeleton loading ---------- */
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.skeleton { background: var(--surface-3); border-radius: var(--radius-sm); animation: skeleton-pulse 1.4s ease-in-out infinite; }
.skeleton-text { height: 12px; border-radius: 4px; margin: 4px 0; }
.skeleton-row td { padding: 14px 20px; }

/* ---------- overlays: modal / drawer ---------- */
.overlay-backdrop {
  position: fixed; inset: 0; background: rgba(18, 16, 25, 0.42); z-index: var(--z-drawer);
  opacity: 0; transition: opacity var(--duration-base) var(--ease); pointer-events: none;
}
.overlay-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface);
  box-shadow: var(--shadow-lg); z-index: var(--z-drawer); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--duration-base) var(--ease);
}
.drawer.open { transform: translateX(0); }
.drawer.wide { width: min(640px, 100vw); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-header h2 { font-size: var(--text-lg); }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--surface-2); }

.modal-wrap { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px;
  opacity: 0; transform: scale(.97) translateY(6px); transition: opacity var(--duration-base) var(--ease), transform var(--duration-base) var(--ease);
  max-height: 88vh; display: flex; flex-direction: column; pointer-events: auto;
}
.modal.wide { max-width: 720px; }
.modal.open { opacity: 1; transform: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-header h2 { font-size: var(--text-lg); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--surface-2); }
.overlay-close { flex: 0 0 30px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; border: none; background: transparent; }
.overlay-close:hover { background: var(--surface-3); color: var(--text); }

/* ---------- toasts ---------- */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; max-width: 360px;
  opacity: 0; transform: translateY(8px); transition: opacity var(--duration-base) var(--ease), transform var(--duration-base) var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast.success { background: var(--success-strong); }
.toast.error { background: var(--danger-strong); }

/* ---------- tooltip ---------- */
/* Открывается ВНИЗ и прижата к левому краю иконки (не по центру) —
   большинство тултипов в приложении стоят в H1 у самого верха страницы
   (первая строка под topbar), поэтому открытие вверх обрезало верх
   бабла за пределами окна браузера, а центрирование по горизонтали
   уводило её за левый край экрана у коротких заголовков. Снизу и справа
   места почти всегда достаточно (страница минимум ~360px шириной). */
.tip { position: relative; display: inline-flex; vertical-align: middle; align-items: center; border-radius: 50%; }
.tip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tip .tip-icon { width: 14px; height: 14px; color: var(--text-tertiary); cursor: help; }
.tip-bubble {
  position: fixed; top: 0; left: 0;
  background: var(--text); color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.4;
  padding: 8px 11px; border-radius: var(--radius-sm); width: max-content; max-width: min(240px, calc(100vw - 48px));
  opacity: 0; pointer-events: none; transition: opacity var(--duration-fast); z-index: var(--z-tooltip); box-shadow: var(--shadow-md);
}
.tip-bubble.open { opacity: 1; transition: opacity var(--duration-fast); }

/* ---------- copyable (click-to-copy technical values) ---------- */
.copyable {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; border-radius: var(--radius-sm); padding: 1px 3px; margin: -1px -3px;
  transition: background var(--duration-fast);
}
.copyable:hover, .copyable:focus-visible { background: var(--surface-2); }
.copyable:focus-visible { outline: 1.5px solid var(--primary); outline-offset: 1px; }
.copyable .copyable-text.mono { font-family: var(--font-mono); }
.copyable .copyable-icon, .copyable .copyable-check {
  width: 12px; height: 12px; flex-shrink: 0; display: inline-flex;
  opacity: 0; transition: opacity var(--duration-fast);
}
.copyable .copyable-icon svg, .copyable .copyable-check svg {
  width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.copyable:hover .copyable-icon, .copyable:focus-visible .copyable-icon { opacity: 1; color: var(--text-tertiary); }
.copyable .copyable-check { position: absolute; right: -1px; color: var(--success); }
.copyable.copied .copyable-icon { opacity: 0; }
.copyable.copied .copyable-check { opacity: 1; }
/* Native title tooltip (не .tip — избегаем тяжёлого bubble ради одной строки) */
.copyable::after {
  content: attr(data-copy-hint); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-size: 10.5px; font-weight: 500; white-space: nowrap;
  padding: 4px 8px; border-radius: var(--radius-sm); opacity: 0; pointer-events: none; transition: opacity var(--duration-fast); z-index: var(--z-tooltip);
}
.copyable:hover::after { opacity: 1; }
.copyable.copied::after { content: "✓ " attr(data-copied-hint); opacity: 1; background: var(--success); }

/* ---------- channel choice (campaign wizard step 1): a compact line for the only channel, a radio list for several ---------- */
.channel-single { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); font-size: var(--text-sm); }
.channel-single .icon, .channel-option .icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--primary); }
.channel-single .icon svg, .channel-option .icon svg { width: 18px; height: 18px; display: block; }
.channel-options { display: grid; gap: var(--sp-2); max-width: 560px; }
.channel-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: border-color var(--duration-fast) var(--ease); }
.channel-option:hover { border-color: var(--text-tertiary); }
.channel-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.channel-option:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.channel-option.disabled { cursor: not-allowed; background: var(--surface-2); }
.channel-option.disabled:hover { border-color: var(--border); }
.channel-option.disabled .icon, .channel-option.disabled .name { color: var(--text-tertiary); }
.channel-option input { margin: 3px 0 0; flex-shrink: 0; }
.channel-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.channel-option .name { font-weight: 600; font-size: var(--text-sm); }
.channel-option .desc { font-size: var(--text-xs); color: var(--text-secondary); overflow-wrap: anywhere; }

/* ---------- wizard stepper ---------- */
.stepper { display: flex; align-items: center; padding: 20px 28px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.step { display: flex; align-items: center; gap: 10px; color: var(--text-tertiary); font-size: var(--text-sm); font-weight: 600; }
.step .step-num {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: flex;
  align-items: center; justify-content: center; font-size: var(--text-xs); flex-shrink: 0; background: var(--surface); color: var(--text-secondary);
}
.step.active { color: var(--text); }
.step.active .step-num { border-color: var(--primary); background: var(--primary); color: var(--text-on-primary); }
.step.done .step-num { border-color: var(--success); background: var(--success); color: #fff; }
.step-connector { flex: 1; height: 1.5px; background: var(--border-strong); margin: 0 12px; min-width: 20px; }
.step-connector.done { background: var(--success); }

/* ---------- radio / selection cards (generic) ---------- */
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; transition: all var(--duration-fast) var(--ease);
}
.option-card:hover { border-color: var(--text-tertiary); }
.option-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.option-card .radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex-shrink: 0; position: relative; }
.option-card.selected .radio { border-color: var(--primary); }
.option-card.selected .radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); }
.option-card .option-title { font-weight: 600; font-size: var(--text-base); }
.option-card .option-desc { font-size: var(--text-xs); color: var(--text-tertiary); }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--border); border: none; margin: var(--sp-4) 0; }
.hint-banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--info-soft); color: var(--info); font-size: var(--text-sm); line-height: 1.5; overflow-wrap:anywhere; min-width:0;
}
.hint-banner svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.progress-bar { height: 6px; border-radius: var(--radius-full); background: var(--surface-3); overflow: hidden; }
.progress-bar .fill { height: 100%; background: var(--primary); border-radius: var(--radius-full); transition: width var(--duration-base) var(--ease); }

/* Platform Overview: compact progressive channel infographic. Bars encode
   the displayed delivery percentage only; no undocumented threshold or
   health conclusion is inferred from their neutral colour. */
.channel-overview-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; padding:16px; }
.channel-overview-card { min-width:0; padding:14px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface-2); display:grid; gap:12px; }
.channel-overview-head { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.channel-overview-head span { color:var(--text-secondary); font-variant-numeric:tabular-nums; }
.channel-overview-numbers { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; color:var(--text-secondary); font-size:var(--text-xs); }
.channel-overview-numbers b { color:var(--text); font-size:var(--text-base); font-variant-numeric:tabular-nums; }
.channel-overview-bar { height:8px; border-radius:var(--radius-full); background:var(--surface-3); overflow:hidden; }
.channel-overview-bar span { display:block; height:100%; border-radius:inherit; background:var(--primary); transition:width var(--duration-base) var(--ease); }

/* User-controlled polling shared by every live dashboard surface. */
.page-header-tools { display:flex; flex-direction:column; align-items:flex-end; gap:6px; min-width:0; }
.auto-refresh { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; color:var(--text-secondary); font-size:var(--text-xs); }
.auto-refresh-toggle, .auto-refresh-period { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.auto-refresh-toggle input { accent-color:var(--primary); }
.auto-refresh-period input { width:64px; height:30px; padding:4px 7px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:var(--text); font:inherit; }
.auto-refresh-state { min-width:64px; }
.dashboard-period { display:inline-flex; align-items:center; gap:7px; color:var(--text-secondary); font-size:var(--text-xs); white-space:nowrap; }
.dashboard-period .select { min-width:104px; }
@media (max-width: 720px) {
  .page-header-tools { width:100%; align-items:flex-start; }
  .auto-refresh { justify-content:flex-start; }
  .dashboard-period { width:100%; justify-content:space-between; }
}


/* ---------- messages: period bar ---------- */
.period-bar { padding-top: 0; gap: 6px; }
.period-field { display: flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--text-secondary); }
.period-field input { width: 176px; }
.period-quick.active { background: var(--primary-soft); border-color: var(--primary); color: var(--text); }
.period-note { padding: 0 14px 8px; }

/* ---------- platform dashboard ---------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.dash-head h1 { font-size: var(--text-xl); }
.dash-head .sub { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.dash-filters { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: 8px 12px; }
.dash-custom { display: inline-flex; align-items: center; gap: 6px; }
.dash-custom input { width: 172px; }
.dash-updated { font-size: var(--text-xs); color: var(--text-tertiary); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg-btn { border: 0; background: transparent; padding: 5px 10px; font: inherit; font-size: var(--text-sm); color: var(--text-secondary); cursor: pointer; border-right: 1px solid var(--border); }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--surface-2); }
.seg-btn.active { background: var(--primary-soft); color: var(--text); font-weight: 600; }
.dash-error { padding: 8px 12px; border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger-strong); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-2); }
.kpi { display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); }
.kpi:disabled { cursor: default; }
.kpi:not(:disabled):hover { border-color: var(--border-strong); background: var(--surface-2); }
.kpi-label { font-size: var(--text-xs); color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: var(--text-xs); color: var(--text-tertiary); min-height: 14px; }
.kpi.ok .kpi-value { color: var(--success-strong); } .kpi.err .kpi-value { color: var(--danger-strong); } .kpi.warn .kpi-value { color: var(--warning); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); align-items: start; }
.dash-wide { grid-column: 1 / -1; }
.dash-grid .card-header { flex-wrap: wrap; }
.dash-grid .card-header h2 { font-size: var(--text-base); flex: 1 1 12rem; }
.dash-grid .legend { flex-wrap: wrap; min-width: 0; }
.dash-grid .legend > span { white-space: nowrap; }
.dash-grid .card-body { padding: 10px 14px; }
.legend { display: flex; gap: 12px; font-size: var(--text-xs); color: var(--text-secondary); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.chart { width: 100%; height: 190px; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--text-tertiary); font-size: 11px; font-family: var(--font-sans); }
.chart-hit { fill: transparent; } .chart-bar:hover .chart-hit { fill: var(--surface-3); opacity: .6; }
.dash-table { width: 100%; font-size: var(--text-sm); }
.dash-table th, .dash-table td { padding: 4px 6px; }
.dash-table .bar-cell { width: 28%; }
.share-bar { display: block; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; } .share-bar > span { display: block; height: 100%; }
.dash-pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: var(--text-sm); }
.dash-pairs > div { display: flex; flex-direction: column; } .dash-pairs span { color: var(--text-tertiary); font-size: var(--text-xs); } .dash-pairs b { font-variant-numeric: tabular-nums; font-weight: 600; }
.dash-note { margin-top: 6px; font-size: var(--text-xs); color: var(--text-tertiary); overflow-wrap: anywhere; }
.dash-warn { font-size: var(--text-xs); color: var(--warning); margin-bottom: 4px; }
.dash-empty { font-size: var(--text-sm); color: var(--text-tertiary); padding: 6px 0; }
.no-data { color: var(--text-tertiary); font-style: italic; font-weight: 400; font-size: var(--text-xs); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-full); padding: 2px 9px; font: inherit; font-size: var(--text-xs); color: var(--text-secondary); }
button.chip { cursor: pointer; } .chip b { color: var(--text); margin-left: 3px; }
.chip-success { background: var(--success-soft); color: var(--success-strong); } .chip-warning { background: var(--warning-soft); color: var(--warning); } .chip-danger { background: var(--danger-soft); color: var(--danger-strong); } .chip-info { background: var(--info-soft); color: var(--info); }
.svc-chips { margin-top: 8px; }
.link-btn { font-size: var(--text-xs); color: var(--info); text-decoration: none; } .link-btn:hover { text-decoration: underline; }
.text-warning { color: var(--warning); } .text-success { color: var(--success-strong); }
@media (max-width: 960px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.dash-custom[hidden] { display: none; }
.dash-filters .select { width: auto; min-width: 150px; max-width: 220px; }

/* ---------- send message ---------- */
.send-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: var(--sp-3); align-items: start; }
.send-form { display: flex; flex-direction: column; gap: 10px; }
.send-form .field { display: flex; flex-direction: column; gap: 4px; }
.send-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.send-form textarea.input { resize: vertical; min-height: 96px; font-family: var(--font-sans); }
.send-actions { display: flex; align-items: center; gap: 10px; }
.send-total { font-size: var(--text-lg); }
.send-result { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); }
@media (max-width: 860px) { .send-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- operator number plan and MNP ---------- */
.np-block { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.np-head h3 { font-size: var(--text-base); }
.np-rows { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.np-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.np-country { width: 54px; text-transform: uppercase; } .np-num { width: 150px; font-family: var(--font-mono); } .np-dash { color: var(--text-tertiary); }
.np-len { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--text-secondary); } .np-len .input { width: 46px; }
.np-err { flex-basis: 100%; min-height: 0; } .np-err:empty { display: none; }
.mnp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; align-items: end; margin-bottom: 8px; }
.mnp-check { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; } .mnp-check .input { width: 220px; }
.np-details { margin-top: 8px; font-size: var(--text-sm); } .np-details ul { margin: 6px 0; padding-left: 18px; }

/* ---------- System -> Queues (operator view) ---------- */
.oq-summary { margin-bottom: 4px; } .oq-note { margin: 4px 0 8px; max-width: 1100px; }
.oq-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.oq-op { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.oq-op > summary { display: grid; grid-template-columns: minmax(160px, 2fr) 120px repeat(3, minmax(80px, 1fr)) 150px; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; }
.oq-op > summary::-webkit-details-marker { display: none; }
.oq-op > summary::before { content: '▸'; position: absolute; margin-left: -10px; color: var(--text-tertiary); } .oq-op[open] > summary::before { content: '▾'; }
.oq-title { font-weight: 600; } .oq-conn { color: var(--text-secondary); font-size: var(--text-sm); }
.oq-num { display: flex; flex-direction: column; line-height: 1.2; } .oq-num b { font-variant-numeric: tabular-nums; } .oq-num span { color: var(--text-tertiary); font-size: var(--text-xs); }
.oq-body { padding: 4px 12px 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.oq-iface-head { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.oq-line { display: grid; grid-template-columns: minmax(180px, 3fr) repeat(3, minmax(70px, 1fr)); gap: 8px 10px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.oq-line .system-row-detail, .oq-line .oq-warn { grid-column: 1 / -1; } .oq-warn { color: var(--warning); font-size: var(--text-xs); }
@media (max-width: 900px) { .oq-op > summary { grid-template-columns: 1fr 1fr; } }
.oq-line .system-row-detail { margin: 0; padding: 0; border: 0; background: transparent; }
.oq-line .system-row-detail > summary { font-size: var(--text-xs); color: var(--text-tertiary); padding: 0; cursor: pointer; }
.oq-line { row-gap: 2px; }

/* HTTP VAS editor: bounded fields, no horizontal scrolling. */
.vas-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.vas-form .field { min-width:0; }
.vas-form .input, .vas-form .select { width:100%; min-width:0; box-sizing:border-box; }
.vas-form .vas-check { display:flex; align-items:center; gap:8px; }
.vas-form .vas-full { grid-column:1/-1; }
@media(max-width:560px) { .vas-form { grid-template-columns:1fr; } }

/* An actionable moderation queue lives with campaigns, not notifications.
   Calm amber: an accent line and an outlined status, no filled row. */
.campaign-needs-review td:first-child { box-shadow:inset 3px 0 var(--warning); }
.tabbar-item.campaign-review-tab { font-weight:700; }
.campaign-review-tab .count { background:var(--warning-soft); color:var(--text); }
.badge-review { background:transparent; color:var(--warning); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--warning) 45%, transparent); }


#camp-tabs > button { appearance:none; font-family:inherit; background:transparent; border-top:0; border-left:0; border-right:0; }
#camp-tabs > button:focus-visible { outline:2px solid var(--primary); outline-offset:-3px; }

/* Every tab remains visible, including narrow record drawers and phones. */
.seg { flex-wrap:wrap; max-width:100%; }
.seg-btn { min-width:0; overflow-wrap:anywhere; }
@media (max-width:600px) {
  .tabbar { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:8px; }
  .tabbar-item { margin-right:0; padding:10px 8px; justify-content:center; text-align:center; white-space:normal; }
  .tabbar-item .count { flex-shrink:0; }
  .seg { display:flex; }
  .seg-btn { flex:1 1 95px; border:0; }
}

/* Native mobile navigation shares the existing tab click handlers. */
.responsive-tab-picker { display:none; }
@media(max-width:600px) {
  .tabbar.responsive-tabs { display:block; }
  .tabbar.responsive-tabs > .tabbar-item { display:none; }
  .responsive-tab-picker { display:block; width:100%; min-width:0; }
  .responsive-tab-picker.has-attention { border-color:var(--warning); }
}

.campaign-detail-heading { flex-wrap:wrap; }
.campaign-detail-heading > div { min-width:0; max-width:100%; }
#cd-lifecycle-actions { flex-wrap:wrap; max-width:100%; }

/* Notifications share one compact, progressively disclosed journal. */
.notification-journal { display: grid; gap: .5rem; }
.notification-item { border: 1px solid var(--border, #dce2ec); border-radius: 12px; background: var(--surface, #fff); min-width: 0; }
.notification-item > summary { cursor: pointer; display: flex; align-items: center; gap: 1rem; padding: 1rem; list-style: none; }
.notification-item > summary::before { content: '›'; font-size: 1.25rem; flex-shrink: 0; transition: transform .15s; }
.notification-item[open] > summary::before { transform: rotate(90deg); }
.notification-item > summary:focus-visible { outline: 2px solid var(--primary, #fa356b); outline-offset: 2px; border-radius: 12px; }
.notification-title { display: grid; gap: .25rem; flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.notification-event { font-size: .85rem; font-weight: 400; color: var(--muted, #65708a); }
.notification-meta { display: flex; align-items: center; justify-content: end; gap: .5rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted, #65708a); min-width: 0; overflow-wrap: anywhere; }
.notification-unread > summary { box-shadow: inset 3px 0 var(--primary, #fa356b); }
.notification-body { padding: 1rem; border-top: 1px solid var(--border, #dce2ec); overflow-wrap: anywhere; }
.notification-body:empty { display: none; }
.notification-rules { border: 1px solid var(--border, #dce2ec); border-radius: 10px; padding: 1rem; min-width: 0; }
.notification-rules legend { padding: 0 .35rem; font-weight: 600; }
.notification-rule { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem 0; flex-wrap: wrap; }
.notification-rule + .notification-rule { border-top: 1px solid var(--border, #dce2ec); }
.notification-rule .checkbox-row { margin: 0; }
.notification-transport-state { font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 600px) {
 .notification-item > summary { flex-wrap: wrap; gap: .5rem; padding: .85rem; }
 .notification-meta { flex-basis: 100%; justify-content: start; padding-left: 1.25rem; }
 .notification-rule { align-items: flex-start; }
 .notification-rule > span { flex-basis: 100%; }
}

/* USSD editor: author .field display must not override its hidden state. */
.ussd-service-form [hidden] { display:none !important; }

.ussd-config-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:20px;}
@media(max-width:600px){.ussd-config-grid{grid-template-columns:minmax(0,1fr);}}

/* USSD draft simulator. All selectors are local to the editor preview. */
.ussd-preview { border-top:1px solid var(--border,#e1e5ee); padding-top:24px; margin-top:8px; min-width:0; }
.ussd-preview-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:20px; }
.ussd-preview-heading h3 { margin:0 0 8px; }
.ussd-preview-heading .sub { margin:0; max-width:640px; }
.ussd-preview-layout { display:grid; grid-template-columns:minmax(0,300px) minmax(0,1fr); gap:28px; align-items:start; }
.ussd-phone { padding:20px; border:2px solid #d9deea; border-radius:32px; background:#fff; box-shadow:0 8px 24px #10214a0a; min-width:0; }
.ussd-phone-speaker { width:48px; height:5px; background:#d6dce8; border-radius:8px; margin:0 auto 18px; }
.ussd-phone-title { font-size:14px; font-weight:700; text-align:center; }
.ussd-phone-status { font-size:12px; color:var(--muted,#68758d); text-align:center; margin:8px 0 16px; overflow-wrap:anywhere; }
.ussd-phone-screen { background:#f4f6fa; border-radius:14px; padding:16px; min-height:110px; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; margin-bottom:16px; }
.ussd-keypad { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:14px 0; }
.ussd-keypad .btn { min-height:42px; justify-content:center; font-size:18px; }
.ussd-phone-actions { display:flex; flex-wrap:wrap; gap:8px; }
.ussd-phone-actions .btn { flex:1 1 100%; white-space:normal; justify-content:center; }
.ussd-preview-error { color:#b4233c; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.ussd-preview-history { min-width:0; }
.ussd-preview-history h4 { margin:0 0 12px; }
.ussd-preview-history ol { list-style:none; margin:0 0 16px; padding:0; max-height:440px; overflow:auto; }
.ussd-preview-history li { margin-bottom:12px; padding:14px; border:1px solid var(--border,#e1e5ee); border-radius:12px; overflow-wrap:anywhere; }
.ussd-preview-history li p { margin:8px 0; white-space:pre-wrap; line-height:1.5; }
.ussd-preview-history li small { color:var(--muted,#68758d); }
@media(max-width:640px) {
 .ussd-preview-layout { grid-template-columns:minmax(0,1fr); gap:24px; }
 .ussd-phone { width:100%; max-width:300px; justify-self:center; padding:16px; box-sizing:border-box; }
 .ussd-preview-heading { flex-wrap:wrap; gap:8px; }
 .ussd-preview-history ol { max-height:280px; }
}

/* Interface capability sections must stay hidden even when their layout is grid. */
.interface-form [hidden]{display:none!important;}
.interface-form .field,.interface-form details{min-width:0;max-width:100%;}
.interface-form [style*="grid-template-columns"]{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr))!important;}
.interface-form input,.interface-form select,.interface-form textarea{max-width:100%;box-sizing:border-box;}
.interface-form summary{cursor:pointer;overflow-wrap:anywhere;padding:10px 0;font-weight:600;}
.interface-form details{margin-bottom:14px;}

/* History pagination must honor the HTML hidden state over .btn display. */
.message-history > .btn[hidden] { display:none !important; }

/* Detail panels grow with the available viewport; narrow screens keep full width. */
.drawer.wide { width:min(1120px,calc(100vw - 32px)); }
@media (max-width:600px) { .drawer.wide { width:100vw; } }

/* Field labels, controls and explanations share rows at each grid breakpoint. */
@supports (grid-template-rows:subgrid) {
  .aligned-field-grid > .field:has(> .field-label) { display:grid; grid-template-rows:subgrid; grid-row:span 3; row-gap:6px; align-items:start; }
  .aligned-field-grid > .field > .field-label { margin:0; }
  .aligned-field-grid > .field > .field-hint { margin:0; }
}
.field.checkbox-row { flex-direction:row; flex-wrap:wrap; justify-content:flex-start; }
.field.checkbox-row > .field-hint { flex-basis:100%; }
.field.checkbox-row > input[type="checkbox"] { width:auto; margin:0; flex:0 0 auto; }
.api-catalog-table { table-layout:auto; width:100%; }
.api-catalog-table th:first-child, .api-catalog-table td:first-child { width:1%; white-space:nowrap; }
.api-catalog-table th:last-child, .api-catalog-table td:last-child { width:clamp(8rem,22vw,20rem); }
.api-service-group th { text-align:left; }

.template-review-text {
  margin: 0;
  padding: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.table-content-aware { width: 100%; table-layout: auto; }
.templates-table { min-width: 760px; }
.templates-table td:first-child { min-width: 12rem; max-width: 35rem; }
.templates-table td:last-child { min-width: 11rem; }
.table-scroll { max-width: 100%; overflow-x: auto; }

/* ---------- filter panel (js/billingTransactionFilters.js) ---------- */
.filter-panel { border-bottom: 1px solid var(--border); }
.filter-bar { display:flex; align-items:center; gap:var(--sp-2); flex-wrap:wrap; padding:var(--sp-3) var(--card-pad, 14px); }
.filter-toggle[aria-expanded="true"] { background:var(--surface-3); }
.filter-count { min-width:18px; height:18px; padding:0 5px; border-radius:var(--radius-full); background:var(--primary); color:var(--text-on-primary); font-size:var(--text-xs); font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.filter-count[hidden], .filter-panel [hidden] { display:none; }
.filter-summary { font-size:var(--text-sm); color:var(--text-secondary); }
.filter-more > summary { padding:0 var(--card-pad, 14px) var(--sp-2); cursor:pointer; color:var(--text-secondary); }
.billing-filter-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px;padding:var(--sp-2) var(--card-pad, 14px) var(--sp-4); }
.filter-panel [data-filter-error]:empty { display:none; }
.filter-panel [data-filter-error] { margin:0; padding:0 var(--card-pad, 14px) var(--sp-3); }
.billing-filter-grid label { display:flex;flex-direction:column;gap:6px;min-width:0; }
.billing-filter-grid .actions { flex-wrap:wrap;align-self:end; }

.mo-text-preview { white-space:pre-wrap;overflow-wrap:anywhere;max-height:4.5em;overflow:hidden;min-width:min(12rem,100%); }

.customer-channels-table { width:100%; table-layout:auto; }
.customer-channels-table th:first-child, .customer-channels-table td:first-child { width:1%; }
.customer-channels-table td:nth-child(2), .customer-channels-table td:nth-child(3) { white-space:nowrap; word-break:normal; }
.customer-channels-table td:last-child { overflow-wrap:break-word; word-break:normal; }
@media (max-width:600px) {
  .customer-channels-table, .customer-channels-table tbody { display:block; width:100%; }
  .customer-channels-table thead { display:none; }
  .customer-channels-table tr { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:0 8px; padding:8px 0; border-bottom:1px solid var(--border); }
  .customer-channels-table td { display:block; width:auto; min-width:0; padding:4px 0; border:0; }
  .customer-channels-table td:first-child { width:auto; }
  .customer-channels-table td:last-child { grid-column:2 / -1; }
}

/* Separate adjacent fields and their help text in USSD/VAS and filter forms.
   Keep the existing single-column flow; long translations may wrap naturally. */
form.form-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
form.form-grid > .btn { justify-self:start; }

/* MFA alternatives: quiet grouped surface, not the browser's default fieldset. */
.mfa-methods {
  min-width: 0;
  margin: 8px 0 24px;
  padding: 20px;
  border: 0;
  border-radius: 20px;
  background: #f5f6fa;
}
.mfa-methods__legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 14px;
  color: #59657b;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}
.mfa-methods__options { clear: both; display: grid; gap: 10px; }
.mfa-methods .mfa-methods__option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #e2e6ee;
  border-radius: 12px;
  background: #fff;
  color: #14213d;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgb(16 29 61 / 3%);
}
.mfa-methods__option::before {
  content: '';
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 1.5px solid #b3bdcc;
  border-radius: 50%;
}
.mfa-methods .mfa-methods__option[aria-pressed="true"] {
  border-color: #ffb5cc;
  background: #fff4f8;
}
.mfa-methods__option[aria-pressed="true"]::before {
  border: 5px solid #ff2c72;
  background: #fff;
}
.mfa-methods .mfa-methods__option:focus-visible {
  outline: 3px solid #ff2c72;
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .mfa-methods { padding: 16px; border-radius: 16px; }
}

/* Queue browser: compact rows with consistent alignment, including idle interfaces. */
.queue-results{margin-top:18px;background:var(--surface, #fff);border:1px solid var(--border);border-radius:16px;overflow:hidden}
.queue-idle-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border-bottom:1px solid var(--border)}
.queue-idle-row:last-child{border-bottom:0}
.queue-idle-row>div{min-width:0;display:grid;gap:5px}
.queue-idle-row strong{font-size:14px;overflow-wrap:anywhere}
.queue-idle-row>div>span{color:var(--text-tertiary);font-size:12px;overflow-wrap:anywhere}
.queue-results>.oq-line{padding:16px 20px;border-bottom:1px solid var(--border)}
.queue-results>.oq-line:last-child{border-bottom:0}
.oq-note{line-height:1.6;max-width:1100px;margin-top:10px}
@media(max-width:600px){.queue-idle-row{align-items:flex-start;flex-direction:column;padding:14px;gap:10px}.queue-results>.oq-line{padding:14px;grid-template-columns:repeat(3,minmax(0,1fr))}.queue-results>.oq-line>.oq-name{grid-column:1/-1;overflow-wrap:anywhere}.queue-idle-row .badge{white-space:normal}}

#q-search{min-width:0} .card:has(#q-search)>.toolbar{display:grid;grid-template-columns:minmax(220px,2fr) minmax(160px,1fr) minmax(160px,1fr);gap:10px;padding:14px}
@media(max-width:800px){.card:has(#q-search)>.toolbar{grid-template-columns:1fr}}

/* Hidden fields must remain hidden despite component display rules. */
.field[hidden], #c-funding-wrap[hidden] { display: none !important; }

/* ---------- aligned card sections (reusable; applied to Billing first) ----------
   One inner edge for the header, section titles, KPI blocks, filters, table cells and pagination. */
.card.aligned { --card-pad: var(--sp-5); }
.card.aligned > .card-header, .card.aligned > .tabbar, .card.aligned > .pagination, .card.aligned > .toolbar { padding-inline: var(--card-pad); }
.card.aligned .table-wrap > table th:first-child, .card.aligned .table-wrap > table td:first-child { padding-left: var(--card-pad); }
.card.aligned .table-wrap > table th:last-child, .card.aligned .table-wrap > table td:last-child { padding-right: var(--card-pad); }
.card-section { padding: var(--sp-4) var(--card-pad, 14px) 0; }
.card-section + .table-wrap { margin-top: var(--sp-2); }
.card-section .stat-grid { margin-bottom: var(--sp-1); }
.section-title { font-size: var(--text-sm); font-weight: 700; color: var(--text); margin: 0; }
.card.aligned .table-wrap + .card-section { border-top: 1px solid var(--border); margin-top: 0; padding-top: var(--sp-5); }
.card.aligned .table-wrap:last-child { margin-bottom: var(--sp-1); }
.empty-inline { padding: var(--sp-4) 0; color: var(--text-tertiary); font-size: var(--text-sm); }
.empty-inline .btn { margin-left: var(--sp-2); }
@media (max-width: 600px) { .card.aligned { --card-pad: var(--sp-4); } }

/* ---------- row actions (js/rowActions.js) ---------- */
/* the actions column stays visible at the right edge of a horizontally scrolled table */
th.actions-cell, td.actions-cell { width: 1%; white-space: nowrap; text-align: right; position: sticky; right: 0; z-index: 1; background: var(--surface); box-shadow: inset 1px 0 var(--border); }
th.actions-cell { background: var(--surface-2); }
tbody tr.clickable:hover td.actions-cell { background: var(--surface-2); }
:is(.table-wrap, .card) > table:not(.sh-table) td.actions-cell { min-width: 0; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); flex-wrap: nowrap; vertical-align: middle; }
.row-action { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast); }
.row-action .icon { width: 18px; height: 18px; }
.row-action:hover, .row-action[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.row-action.danger:hover { background: var(--danger-soft); color: var(--danger-strong); }
.row-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
@media (hover: hover) { .row-action-more.touch-only { display: none; } }
@media (hover: none) { .row-actions > .row-action:not(.row-action-more) { display: none; } .row-action { width: 40px; height: 40px; } }
.ra-tooltip { position: fixed; z-index: var(--z-tooltip); max-width: 260px; padding: 5px 8px; border-radius: 6px; background: var(--text); color: var(--surface);
  font-size: var(--text-xs); font-weight: 600; line-height: 1.35; white-space: normal; pointer-events: none; box-shadow: var(--shadow-md); }
.ra-menu { position: fixed; z-index: var(--z-tooltip); min-width: 200px; max-width: min(320px, calc(100vw - 16px)); padding: var(--sp-1);
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.ra-tooltip[hidden], .ra-menu[hidden] { display: none; }
.ra-menu-item { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer; }
.ra-menu-item .icon { width: 16px; height: 16px; flex: none; color: var(--text-secondary); }
.ra-menu-item:hover, .ra-menu-item:focus-visible { background: var(--surface-3); outline: none; }
.ra-menu-item.danger, .ra-menu-item.danger .icon { color: var(--danger-strong); }
@media (hover: none) { .ra-menu-item { min-height: 44px; } }

/* ---------- confirmation with object details (confirmWithDetails) ---------- */
.confirm-intro { margin: 0 0 var(--sp-3); color: var(--text-secondary); line-height: 1.5; }
.confirm-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 var(--sp-3); font-size: var(--text-sm); }
.confirm-details dt { color: var(--text-tertiary); }
.confirm-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.confirm-note { margin: 0 0 var(--sp-3); font-size: var(--text-sm); color: var(--text-secondary); }
.field-error { color: var(--danger-strong); font-size: var(--text-xs); margin: 4px 0 0; }
.field-error:empty { display: none; }
.tx-code { display: block; margin-top: 2px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; color: var(--text-tertiary); }

/* ---------- campaign payment block (js/campaignPaymentBlock.js) ---------- */
.pay-block { border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); }
.pay-block.incomplete { border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.pay-block > header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.pay-block h3 { margin: 0; font-size: var(--text-md); }
.pay-block dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--sp-4); margin: 0; font-size: var(--text-sm); }
.pay-row { display: contents; }
.pay-row dt { color: var(--text-secondary); }
.pay-row dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-row.pay-main dt, .pay-row.pay-main dd { font-size: var(--text-md); color: var(--text); padding: 4px 0; }
.pay-unknown { color: var(--text-tertiary); font-style: italic; }
.pay-note { display: block; font-size: var(--text-xs); color: var(--text-tertiary); font-weight: 400; }
.pay-short { color: var(--danger-strong); }
.pay-rule { margin: var(--sp-3) 0 0; font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5; }
.footer-reason { max-width: 480px; font-size: var(--text-xs); color: var(--danger-strong); line-height: 1.4; }
.footer-reason:empty { display: none; }
.estimate-fix { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; padding-top: var(--sp-2); border-top: 1px solid var(--border); }
@media (max-width: 600px) {
  .pay-block { padding: var(--sp-4); }
  .pay-block dl { grid-template-columns: 1fr; gap: 2px; }
  .pay-row dd { text-align: left; margin-bottom: 6px; }
  .footer-reason { max-width: 100%; flex-basis: 100%; }
}

/* ---------- API keys: IP allowlist (migration 206) ---------- */
.req-star { color: var(--danger-strong, var(--danger)); margin-left: 3px; font-weight: 700; }
.nowrap { white-space: nowrap; }
.state-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.state-dot .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--text-tertiary); }
.state-dot.state-warning .dot { background: var(--warning); }
.state-dot.state-danger .dot { background: var(--danger-strong, var(--danger)); }
.state-dot.state-success .dot { background: var(--success-strong, var(--success)); }
.ip-cell { min-width: 190px; }
.ip-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.ip-list code { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text); white-space: nowrap; }
.ip-allowlist-field textarea { width: 100%; resize: vertical; }
.ip-my-address { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-secondary); }
.ip-my-address code { font-family: var(--font-mono); margin-left: 4px; color: var(--text); }
.ip-my-address .field-hint { flex-basis: 100%; }
/* API keys table fits 1440 px: compact dates and actions; narrower screens scroll inside .table-wrap, not the page */
.ak-table th, .ak-table td { padding-left: 10px; padding-right: 10px; }
:is(.table-wrap, .card) > table.ak-table td.ak-compact { min-width: 0; white-space: nowrap; }
.ak-table th.ak-compact { white-space: nowrap; }
.ak-table td.ip-cell { min-width: 170px; }
.ip-more { font-size: var(--text-xs); color: var(--text-tertiary); }

/* ---------- SMPP accounts: IP allowlist (migration 211) — table fits the settings modal at 1440 px, scrolls inside .table-wrap on phones ---------- */
.modal.wide.smpp-settings-modal { max-width: 880px; }
.smpp-cred-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.smpp-cred-head p { margin: 0; flex: 1 1 260px; }
.smpp-cred-table { min-width: 560px; }
.smpp-cred-table th, .smpp-cred-table td { padding-left: 10px; padding-right: 10px; vertical-align: top; }
:is(.table-wrap, .card) > table.smpp-cred-table td.sc-compact { min-width: 0; white-space: nowrap; }
.smpp-cred-table th.sc-compact { white-space: nowrap; }
.smpp-cred-table td.ip-cell { min-width: 170px; }
.sc-secret { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; }
.sc-secret dt { color: var(--text-secondary); font-size: var(--text-sm); }
.sc-secret dd { margin: 0; }
.sc-secret code { font-family: var(--font-mono); font-size: var(--text-md, 15px); user-select: all; }
.smpp-cred-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* «Скачать таблицу» под таблицей API-ключей */
.table-download { display: flex; justify-content: flex-end; padding: 0 16px 14px; }

/* On/off switch with the state as a dot and a word (owner 26.11: no bare checkboxes for settings): <label class="toggle-switch">
   <input type="checkbox" role="switch"><span class="toggle-switch-track"></span><span class="toggle-switch-text">…</span><span class="state-dot">…</span></label> */
.toggle-switch { display:flex; align-items:center; gap:10px 12px; flex-wrap:wrap; cursor:pointer; min-height:44px; position:relative; }
.toggle-switch input { position:absolute; opacity:0; width:1px; height:1px; }
.toggle-switch-track { position:relative; flex:0 0 auto; width:40px; height:22px; border-radius:999px; background:var(--border-strong, #c5cad6); transition:background .15s; }
.toggle-switch-track::after { content:""; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:#fff; transition:transform .15s; box-shadow:0 1px 3px #13213c40; }
.toggle-switch input:checked + .toggle-switch-track { background:var(--primary); }
.toggle-switch input:checked + .toggle-switch-track::after { transform:translateX(18px); }
.toggle-switch input:focus-visible + .toggle-switch-track { outline:2px solid var(--primary); outline-offset:2px; }
.toggle-switch input:disabled + .toggle-switch-track { opacity:.5; }
.toggle-switch-text { font-weight:600; min-width:0; flex:0 1 auto; }
@media (prefers-reduced-motion:reduce) { .toggle-switch-track, .toggle-switch-track::after { transition:none; } }
/* a select whose chosen text does not fit shows it in full under the field (selectFull.js) */
.select-full { margin-top:6px; font-size:var(--text-sm, 13px); line-height:1.45; color:var(--text-secondary); overflow-wrap:anywhere; }
