:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d9dee6;
  --text: #17202a;
  --muted: #667085;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --warn: #b54708;
}

.notification-incident-list {
  display: grid;
  gap: 1rem;
}

.notification-incident-card,
.notification-test-result-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  background: color-mix(in srgb, var(--panel) 94%, var(--accent) 6%);
}

.notification-progress-line {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1fr);
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 0;
}

.notification-progress-line progress {
  width: 100%;
}

.notification-member-states,
.notification-incident-actions,
.notification-history-filters {
  margin-block: 0.75rem;
}

.notification-event-list {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.notification-test-result-card pre {
  white-space: pre-wrap;
  margin-bottom: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  min-height: 58px;
  padding: 8px 28px;
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 760;
  gap: 9px;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  border-radius: 7px;
  flex: 0 0 auto;
  height: 28px;
  width: 28px;
}

.nav-disclosure {
  display: flex;
  flex: 1 1 540px;
  min-width: 0;
}

.nav-summary {
  display: none;
}

.nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.nav a {
  border-radius: 6px;
  color: var(--muted);
  padding: 7px 10px;
  white-space: nowrap;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.is-active {
  background: #eef1f5;
  color: var(--text);
  text-decoration: none;
}

.nav a:focus-visible {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.nav a.is-active {
  background: #e3f5f1;
  color: var(--accent-strong);
  font-weight: 750;
}

.user-menu {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.user-menu form {
  margin-left: 0;
}

.user-menu-text {
  display: grid;
  gap: 1px;
  line-height: 1.15;
  text-align: right;
}

.user-menu-text strong {
  font-size: 13px;
}

.user-menu-text span {
  color: var(--muted);
  font-size: 12px;
}

.main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px;
}

.page-title {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-title > * {
  min-width: 0;
}

.page-title h1 {
  overflow-wrap: anywhere;
}

.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.18;
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.dashboard-page-title {
  margin-bottom: 12px;
}

.dashboard-page-title > div {
  min-width: 0;
}

.dashboard-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: nowrap;
  font-size: 16px;
  gap: 8px;
  line-height: 1.25;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.dashboard-heading-main {
  flex: 0 0 auto;
}

.dashboard-heading-note {
  color: var(--muted);
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muted {
  color: var(--muted);
}

.grid {
  align-items: start;
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.stat,
.flash {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 18px;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.grid > *,
.section-stack > *,
.list-editor-grid > * {
  min-width: 0;
}

.panel.compact {
  padding: 16px;
}

.flash.compact {
  padding: 14px;
}

.panel-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header h2,
.panel-header p {
  margin-bottom: 0;
}

.panel-title-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 2px;
}

.panel-title-row h2 {
  margin-bottom: 0;
}

.detail-page {
  display: grid;
  gap: 12px;
}

.detail-page .page-title {
  margin-bottom: 2px;
}

.summary-metrics {
  min-width: 0;
  padding: 12px 14px;
}

.summary-metrics-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0;
}

.summary-metrics-grid div {
  border-left: 1px solid var(--line);
  min-width: 0;
  padding: 4px 12px;
}

.summary-metrics-grid div:first-child {
  border-left: 0;
  padding-left: 0;
}

.summary-metrics-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.summary-metrics-grid dd {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  margin: 3px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-metrics-grid dd code {
  font-size: 13px;
}

.workspace-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.workspace-grid > * {
  min-width: 0;
}

.section-panel {
  display: grid;
  gap: 12px;
}

.collection-table-panel {
  display: grid;
  gap: 12px;
}

.dense-table th,
.dense-table td {
  padding: 6px 8px;
}

.table.key-value-table {
  min-width: 0;
  table-layout: fixed;
}

.table.key-value-table th {
  width: 34%;
}

.table.key-value-table td {
  overflow-wrap: anywhere;
}

.table.key-value-table code {
  overflow-wrap: anywhere;
  white-space: normal;
}

.danger-panel {
  background: #fff7f5;
  border-color: #fda29b;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.danger-panel h2,
.danger-panel p {
  margin-bottom: 0;
}

.danger-panel p {
  margin-top: 4px;
}

.inline-result-panel {
  margin-top: 12px;
}

.inline-result-panel:empty {
  margin-top: 0;
}

.page-kicker-code {
  max-width: min(620px, 72vw);
}

.list-editor-grid {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}

.list-collapse-card {
  overflow: hidden;
}

.list-collapse-summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  list-style: none;
  min-width: 0;
  padding: 10px 12px;
}

.list-collapse-summary::-webkit-details-marker {
  display: none;
}

.list-card-title {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 15px;
  font-weight: 800;
  gap: 8px;
  min-width: 0;
}

.list-card-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card-chevron {
  color: var(--muted);
  flex: 0 0 auto;
  height: 16px;
  transition: transform 120ms ease;
  width: 16px;
}

.list-collapse-card[open] .list-card-chevron {
  transform: rotate(90deg);
}

.list-card-overview {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 0;
}

.list-card-pills {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.list-card-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
}

.list-card-note b {
  color: var(--text);
}

.list-card-body {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.list-details-panel {
  grid-template-rows: auto auto 1fr auto;
}

.list-details-panel textarea {
  min-height: 124px;
}

.list-rebuild-panel {
  align-items: center;
  background: #fff7f5;
  border-color: #fda29b;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 10px 12px;
}

.list-rebuild-panel h2 {
  font-size: 15px;
  margin-bottom: 2px;
}

.list-rebuild-panel p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin: 0;
}

.list-rebuild-panel button {
  white-space: nowrap;
}

.list-action-panel {
  align-content: space-between;
  gap: 14px;
}

.list-detail-page .page-title {
  margin-bottom: 12px;
}

.list-detail-page .flash {
  margin-bottom: 10px;
  padding: 10px 12px;
}

.list-detail-page .panel {
  padding: 12px 14px;
}

.list-detail-page .list-collapse-card {
  padding: 0;
}

.list-detail-page .list-section {
  margin-top: 10px;
}

.list-detail-page h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

.list-detail-page .muted,
.list-detail-page .field-hint {
  font-size: 12px;
  line-height: 1.3;
}

.list-detail-page .list-editor-grid {
  gap: 10px;
}

.list-detail-page .form-grid,
.list-detail-page .list-action-panel {
  gap: 8px;
}

.local-bulk-form .script-textarea.compact {
  min-height: 150px;
}

.list-detail-page label {
  gap: 4px;
}

.list-detail-page input,
.list-detail-page select,
.list-detail-page textarea {
  min-height: 34px;
  padding: 6px 8px;
}

.list-detail-page textarea,
.list-detail-page .list-details-panel textarea {
  min-height: 68px;
}

.list-detail-page button,
.list-detail-page .button {
  min-height: 34px;
  padding: 6px 10px;
}

.list-detail-page button.small,
.list-detail-page .button.small {
  min-height: 30px;
  padding: 4px 8px;
}

.list-detail-page .list-rebuild-panel {
  margin-bottom: 10px;
  padding: 8px 10px;
}

.list-detail-page .list-rebuild-panel h2 {
  font-size: 14px;
}

.list-detail-page .disclosure-summary,
.list-detail-page .disclosure-body {
  padding: 12px 14px;
}

.list-detail-page .disclosure-title {
  font-size: 16px;
}

.list-detail-page .script-textarea.compact {
  min-height: 160px;
}

.list-detail-page .url-source-form,
.list-detail-page .asn-source-form,
.list-detail-page .entry-filter-form {
  gap: 8px;
}

.list-detail-page .source-table-wrap {
  margin-top: 8px;
}

.list-detail-page .table th,
.list-detail-page .table td {
  padding: 6px 8px;
}

.list-detail-page .entry-table th,
.list-detail-page .entry-table td {
  padding: 4px 8px;
}

.list-detail-page .actions {
  gap: 6px;
}

.list-detail-page .pill {
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 6px;
}

.list-detail-page .empty-state {
  padding: 10px 8px;
}

.enrollment-layout {
  max-width: 1040px;
}

.enrollment-controls h2,
.enrollment-controls p {
  margin-bottom: 0;
}

.page-alerts:not(:empty) {
  margin-bottom: 18px;
}

.create-region:not(:empty) {
  margin-bottom: 18px;
}

.create-panel {
  max-width: 760px;
}

.auth-panel {
  margin: 8vh auto 0;
  max-width: 420px;
}

.users-page {
  display: grid;
  gap: 12px;
}

.users-page .page-title {
  margin-bottom: 2px;
}

.users-page .flash {
  padding: 12px 14px;
}

.users-summary-metrics {
  padding: 10px 12px;
}

.users-create-grid {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.users-create-card {
  gap: 9px;
  height: 100%;
  padding: 14px;
}

.users-create-card > button {
  align-self: end;
  margin-top: auto;
  min-height: 38px;
}

.users-create-card textarea {
  min-height: 64px;
}

.users-page .compact-fieldset {
  max-height: 148px;
  padding: 10px;
}

.users-page .access-group-list-fieldset {
  max-height: none;
  overflow: visible;
}

.users-page .checkbox-row {
  gap: 7px;
}

.users-table-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.users-table {
  min-width: 840px;
}

.access-groups-table {
  min-width: 760px;
}

.users-table th,
.users-table td {
  padding: 7px 8px;
  vertical-align: middle;
}

.users-table td:last-child {
  text-align: right;
  width: 1%;
}

.users-table .pill {
  margin: 1px 2px 1px 0;
}

.data-transfer-page {
  display: grid;
  gap: 12px;
}

.data-transfer-page .page-title {
  margin-bottom: 2px;
}

.data-transfer-layout {
  align-items: start;
}

.data-transfer-layout .panel {
  height: 100%;
}

.data-transfer-layout .checkbox-grid {
  grid-template-columns: minmax(0, 1fr);
}

.data-transfer-layout .checkbox-row {
  align-items: flex-start;
}

.data-transfer-layout .checkbox-row strong {
  color: var(--text);
}

.data-transfer-layout .checkbox-row .field-hint {
  display: block;
  margin-top: 2px;
}

.data-transfer-result-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 10px 0;
}

.data-transfer-result-grid > div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.data-transfer-table-wrap {
  margin-top: 8px;
}

.modal-layer {
  align-items: flex-start;
  display: none;
  inset: 0;
  justify-content: center;
  overflow: auto;
  padding: 28px;
  position: fixed;
  z-index: 100;
}

.modal-layer:target {
  display: flex;
}

.modal-backdrop {
  background: rgba(16, 24, 40, 0.48);
  inset: 0;
  position: fixed;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
  margin: auto;
  max-height: calc(100vh - 56px);
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  padding: 16px;
  position: relative;
  width: min(520px, calc(100vw - 56px));
  z-index: 1;
}

.modal-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.modal-header h2 {
  margin-bottom: 3px;
}

.users-modal-card {
  padding: 14px;
  width: min(500px, calc(100vw - 56px));
}

.users-row-details {
  display: grid;
  gap: 12px;
  text-align: left;
}

.users-row-details .form-grid {
  gap: 9px;
}

.users-row-details form + form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.dashboard-status {
  display: grid;
  gap: 22px;
}

.dashboard-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
}

.dashboard-stat {
  align-items: center;
  border-left: 3px solid #98a2b3;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 9px;
}

.dashboard-stat .muted {
  flex: 1 1 auto;
  font-size: 12px;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-stat strong {
  display: inline;
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.dashboard-stat.is-online {
  border-left-color: #079455;
}

.dashboard-stat.is-offline {
  border-left-color: #d92d20;
}

.dashboard-stat.is-never-seen {
  border-left-color: #98a2b3;
}

.dashboard-stat.is-blocked {
  border-left-color: #344054;
}

.dashboard-stat.is-disabled {
  border-left-color: #667085;
}

.dashboard-stat.is-failed {
  border-left-color: #b54708;
}

.dashboard-groups {
  display: grid;
  gap: 0;
}

.dashboard-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  min-width: 0;
}

.dashboard-group.is-disabled {
  background: #f8f9fb;
}

.dashboard-group + .dashboard-group {
  border-top: 0;
  border-radius: 0;
}

.dashboard-group:first-child {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dashboard-group:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.dashboard-group-header {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  list-style: none;
  min-width: 0;
  padding: 10px 12px;
}

.dashboard-group-header::-webkit-details-marker {
  display: none;
}

.dashboard-group-title {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-width: 0;
}

.dashboard-group-title > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-group-chevron {
  color: var(--muted);
  flex: 0 0 auto;
  height: 16px;
  transition: transform 120ms ease;
  width: 16px;
}

.dashboard-group[open] .dashboard-group-chevron {
  transform: rotate(90deg);
}

.dashboard-group-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-group.is-disabled .dashboard-group-name {
  color: #667085;
}

.dashboard-group-header h2 {
  margin-bottom: 4px;
}

.dashboard-group-overview {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 0;
}

.dashboard-group-pills {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.dashboard-group-pull-summary {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  gap: 4px 10px;
  justify-content: flex-end;
  line-height: 1.2;
}

.dashboard-group-pull-summary b {
  color: var(--text);
}

.device-status-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding: 0 12px 12px;
}

.device-status-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 3px solid #98a2b3;
  border-radius: 6px;
  color: var(--text);
  display: grid;
  gap: 4px;
  min-height: 86px;
  min-width: 0;
  padding: 7px 8px;
  position: relative;
  text-decoration: none;
}

.device-status-card:hover,
.device-status-card:focus {
  border-color: #98a2b3;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  outline: none;
  text-decoration: none;
  z-index: 12;
}

.device-status-card.is-online {
  border-left-color: #079455;
}

.device-status-card.is-offline {
  border-left-color: #d92d20;
}

.device-status-card.is-never-seen {
  border-left-color: #98a2b3;
}

.device-status-card.is-blocked {
  border-left-color: #344054;
}

.device-status-card.is-disabled {
  background: #f8f9fb;
  border-color: #d0d5dd;
  border-left-color: #667085;
  color: #667085;
}

.device-status-card.has-failed {
  background: #fffaf0;
  border-bottom-color: #fedf89;
  border-right-color: #fedf89;
  border-top-color: #fedf89;
}

.device-status-card strong,
.device-status-card span {
  min-width: 0;
}

.device-status-card strong {
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-status-line {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  line-height: 1.15;
  min-width: 0;
  white-space: nowrap;
}

.device-status-badge {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  gap: 6px;
  line-height: 1.15;
}

.status-dot {
  background: #98a2b3;
  border-radius: 999px;
  flex: 0 0 auto;
  height: 7px;
  width: 7px;
}

.device-status-card.is-online .status-dot {
  background: #079455;
}

.device-status-card.is-offline .status-dot {
  background: #d92d20;
}

.device-status-card.is-blocked .status-dot {
  background: #344054;
}

.device-status-card.is-disabled .status-dot {
  background: #667085;
}

.device-status-meta,
.device-status-subline,
.device-status-facts,
.device-status-warning {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.device-status-meta {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-status-warning {
  color: #b54708;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-status-subline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-status-facts {
  align-items: center;
  display: flex;
  gap: 6px 10px;
  overflow: hidden;
}

.device-status-facts span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-status-facts b {
  color: var(--text);
}

.device-status-popover {
  background: #101828;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(16, 24, 40, 0.22);
  color: #ffffff;
  display: none;
  gap: 10px;
  left: 0;
  max-width: calc(100vw - 48px);
  padding: 12px;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 8px);
  width: 340px;
  z-index: 30;
}

.device-status-card:hover .device-status-popover,
.device-status-card:focus .device-status-popover,
.device-status-card:focus-within .device-status-popover {
  display: grid;
}

.popover-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.popover-grid {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: max-content minmax(0, 1fr);
}

.popover-grid span {
  color: #d0d5dd;
}

.popover-grid b {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  width: 100%;
}

.table {
  border-collapse: collapse;
  min-width: 680px;
  width: 100%;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.settings-table input {
  max-width: 160px;
}

.settings-info-panel {
  display: grid;
  gap: 12px;
}

.worker-history-header {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.worker-history-header h3,
.worker-history-header p {
  margin: 0;
}

.worker-history-filter-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(170px, 220px) minmax(140px, 180px) minmax(100px, 120px) auto auto;
}

.worker-history-filter-form label {
  display: grid;
  gap: 4px;
}

.worker-history-filter-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.worker-history-table {
  min-width: 900px;
}

.worker-history-table td:nth-child(5),
.worker-history-table td:nth-child(6) {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.table tr.is-attention-row td {
  background: #fff7f5;
}

.settings-summary-metrics {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.group-detail-page {
  display: grid;
  gap: 12px;
}

.group-detail-page > *,
.group-editor-grid > * {
  min-width: 0;
}

.group-detail-page .page-title {
  margin-bottom: 2px;
}

.group-tabs {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
  max-width: 100%;
  min-width: 0;
}

.group-tab {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  display: inline-flex;
  font-weight: 700;
  gap: 6px;
  margin-bottom: -1px;
  min-height: 38px;
  min-width: 0;
  padding: 8px 12px;
}

.group-tab:hover {
  background: #eef1f5;
  color: var(--text);
  text-decoration: none;
}

.group-tab.is-active {
  background: var(--panel);
  border-color: var(--line);
  border-bottom-color: var(--panel);
  color: var(--text);
}

.group-summary-panel,
.group-details-panel,
.group-lists-panel,
.group-devices-panel {
  padding: 14px;
}

.group-summary-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
}

.group-summary-grid div {
  border-left: 1px solid var(--line);
  padding: 4px 12px;
}

.group-summary-grid div:first-child {
  border-left: 0;
  padding-left: 0;
}

.group-summary-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.group-summary-grid dd {
  font-size: 22px;
  font-weight: 800;
  margin: 2px 0 0;
}

.group-editor-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.group-details-panel {
  align-content: start;
}

.group-details-panel textarea {
  min-height: 110px;
}

.group-lists-panel {
  display: grid;
  gap: 12px;
}

.group-devices-panel,
.group-devices-form {
  display: grid;
  gap: 12px;
}

.group-device-filter-bar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 0.5fr) minmax(420px, 1fr);
}

.group-device-filter-title {
  display: grid;
  gap: 2px;
}

.group-device-filter-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto auto;
}

.group-devices-table {
  min-width: 720px;
}

.group-devices-table th,
.group-devices-table td {
  vertical-align: middle;
}

.group-devices-table th:first-child,
.group-devices-table td:first-child {
  text-align: center;
  width: 1%;
}

.group-devices-actions {
  display: flex;
  justify-content: flex-start;
}

.group-assignment-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto;
}

.group-assignment-note {
  margin: -2px 0 0;
}

.group-danger-panel {
  margin-top: 0;
}

.routeros-update-panel {
  gap: 12px;
}

.routeros-update-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(150px, 220px)) auto;
  justify-content: start;
}

.device-detail-page .routeros-update-form {
  grid-template-columns: minmax(150px, 220px) auto;
}

.routeros-update-table {
  min-width: 900px;
}

.routeros-update-table th,
.routeros-update-table td {
  vertical-align: middle;
}

.routeros-target-list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.routeros-target-item {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  min-width: 0;
}

.assigned-lists-table {
  min-width: 520px;
}

.assigned-lists-table th,
.assigned-lists-table td {
  padding: 5px 8px;
  vertical-align: middle;
}

.assigned-lists-table td:last-child {
  text-align: right;
  width: 1%;
}

.assigned-lists-table form {
  display: inline-flex;
}

.assigned-lists-table .icon-button {
  min-height: 26px;
  min-width: 26px;
  padding: 3px;
}

.assigned-lists-table .icon-button svg {
  height: 14px;
  width: 14px;
}

.script-assignments-table {
  min-width: 0;
  table-layout: fixed;
}

.script-assignments-table th:last-child,
.script-assignments-table td:last-child {
  text-align: right;
  width: 180px;
}

.script-assignments-table td:first-child {
  overflow-wrap: anywhere;
}

.script-assignments-table td:last-child .actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.script-assignments-table td:last-child form {
  flex: 0 0 auto;
}

.device-detail-page .panel,
.script-detail-page .panel {
  padding: 14px;
}

.device-page-title {
  align-items: center;
}

.device-title-copy {
  min-width: 0;
}

.device-title-copy h1,
.device-identity-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-identity-line {
  max-width: min(760px, 72vw);
}

.device-detail-page .summary-metrics,
.script-detail-page .summary-metrics {
  padding: 10px 12px;
}

.device-summary-metrics {
  background: #f8fafc;
}

.device-detail-page .summary-metrics-grid {
  grid-template-columns:
    minmax(90px, 0.7fr)
    minmax(128px, 0.85fr)
    minmax(210px, 1.45fr)
    repeat(5, minmax(92px, 0.7fr));
}

.device-detail-page .summary-metrics-grid div {
  padding: 3px 10px;
}

.device-detail-page .summary-metrics-grid dd {
  font-size: 16px;
}

.device-detail-page .summary-metrics-grid dd code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.device-tabs {
  margin-top: -2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.device-tabs .group-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.device-token-flash {
  padding: 12px 14px;
}

.device-token-result {
  margin-top: 12px;
}

.device-action-form {
  margin-top: 12px;
}

.device-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.device-overview-grid {
  grid-template-columns: minmax(0, 1fr);
}

.device-groups-grid {
  grid-template-columns: minmax(0, 1fr);
}

.device-lists-grid {
  grid-template-columns: minmax(0, 1fr);
}

.device-details-panel,
.device-state-panel,
.device-groups-panel,
.device-overrides-panel,
.device-effective-panel,
.device-cleanup-panel,
.device-inventory-panel {
  align-content: start;
}

.device-state-panel {
  display: grid;
  gap: 12px;
}

.device-state-table {
  min-width: 520px;
}

.device-state-actions {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.device-state-actions .device-action-form {
  margin-top: 0;
}

.device-groups-panel,
.device-overrides-panel {
  gap: 12px;
}

.device-group-checkbox-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  padding: 10px;
}

.device-group-checkbox-list .checkbox-row {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  padding: 9px 10px;
}

.device-group-row-content,
.device-group-row-title,
.device-group-name,
.device-group-description {
  min-width: 0;
  overflow-wrap: anywhere;
}

.device-group-row-content {
  display: grid;
  gap: 3px;
}

.device-group-row-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.device-group-description {
  color: var(--muted);
  line-height: 1.35;
}

.device-overrides-panel .actions {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px) auto;
}

.device-overrides-table {
  min-width: 640px;
}

.device-effective-table {
  min-width: 640px;
}

.device-overrides-table th:last-child,
.device-overrides-table td:last-child {
  text-align: right;
  width: 1%;
}

.device-effective-panel,
.device-cleanup-panel,
.device-inventory-panel {
  gap: 10px;
}

.script-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.device-detail-page textarea {
  min-height: 92px;
}

.device-detail-page .checkbox-list {
  max-height: 180px;
}

.script-detail-page textarea:not(.script-textarea) {
  min-height: 72px;
}

.schedule-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
}

.schedule-fieldset legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 6px;
  text-transform: uppercase;
}

.schedule-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.script-assignment-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto;
}

.assignment-note {
  margin: -2px 0 0;
}

.script-status-table {
  min-width: 940px;
}

.script-status-table td:last-child {
  text-align: right;
  width: 1%;
}

.empty-state {
  color: var(--muted);
  padding: 16px 8px;
}

.nowrap {
  white-space: nowrap;
}

.truncate-code {
  display: inline-block;
  max-width: min(460px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.form-grid {
  align-content: start;
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: minmax(0, 1fr);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
}

.bitrix-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.bitrix-picker-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

.bitrix-picker-heading .checkbox-row {
  font-weight: 400;
}

.bitrix-selected-list {
  display: grid;
  gap: 6px;
}

.bitrix-selected-list:empty::before {
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  content: attr(data-empty-text);
  font-size: 12px;
  padding: 8px 10px;
}

.bitrix-selected-card {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 10px;
}

.bitrix-selected-card > div,
.bitrix-search-result {
  min-width: 0;
}

.bitrix-selected-card strong,
.bitrix-selected-card span,
.bitrix-search-result strong,
.bitrix-search-result span {
  display: block;
  overflow-wrap: anywhere;
  text-align: left;
}

.bitrix-selected-card span,
.bitrix-search-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-top: 2px;
}

.bitrix-search-results:not(:empty) {
  margin-top: -2px;
}

.bitrix-search-result-list {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

button.bitrix-search-result {
  align-items: stretch;
  background: #ffffff;
  border-color: transparent;
  color: var(--text);
  display: grid;
  justify-content: stretch;
  min-height: 0;
  padding: 8px;
  width: 100%;
}

button.bitrix-search-result:hover:not(:disabled) {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: var(--text);
}

.bitrix-search-message {
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
}

.bitrix-search-message.is-error {
  color: var(--danger);
}

.token-linked-fields {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
}

.token-control-pair {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 12px;
}

.token-control-pair legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #c8d0da;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.form-grid > button,
.form-grid > .actions {
  justify-self: start;
}

.disclosure-panel {
  padding: 0;
}

.disclosure-summary {
  cursor: pointer;
  padding: 18px;
}

.disclosure-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.18;
}

.disclosure-body {
  border-top: 1px solid var(--line);
  padding: 18px;
}

.url-source-form,
.asn-source-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 180px) auto;
}

.asn-source-form {
  grid-template-columns: minmax(160px, 220px) minmax(150px, 180px) auto;
}

.url-source-url,
.url-source-interval,
.asn-source-asn,
.asn-source-interval {
  min-width: 0;
}

.entry-filter-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr) auto auto;
  margin-bottom: 14px;
}

.device-filter-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 180px) minmax(180px, 220px) minmax(240px, 1fr) auto auto;
  margin-bottom: 8px;
}

.device-filter-summary {
  margin-bottom: 12px;
}

.log-filter-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 180px) minmax(240px, 1fr) minmax(120px, 150px) auto;
  margin-bottom: 18px;
}

.backup-stats-filter-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.backup-stats-filter-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 0;
}

.backup-stats-filter-details summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 800;
  gap: 8px;
  justify-content: space-between;
  list-style: none;
  min-height: 40px;
  padding: 8px 10px;
}

.backup-stats-filter-details summary::-webkit-details-marker {
  display: none;
}

.backup-stats-filter-details summary span:first-child {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.backup-stats-filter-details[open] {
  padding-bottom: 10px;
}

.backup-stats-filter-details[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.backup-stats-filter-details .backup-stats-filter-form {
  padding: 0 10px;
}

.backup-stats-filter-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.backup-stats-title-row > div {
  min-width: 0;
}

.backup-stats-count-pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.backup-stats-table {
  min-width: 800px;
  table-layout: fixed;
}

.backup-stats-table .truncate-code {
  max-width: 100%;
}

.backup-stats-table th,
.backup-stats-table td {
  min-width: 0;
}

.backup-stats-col-time {
  width: 126px;
}

.backup-stats-col-status,
.backup-stats-col-kind {
  width: 88px;
}

.backup-stats-col-device {
  width: 166px;
}

.backup-stats-col-group {
  width: 116px;
}

.backup-stats-col-profile {
  width: 76px;
}

.backup-stats-col-sensitive {
  width: 84px;
}

.backup-stats-col-size {
  width: 78px;
}

.backup-stats-col-message {
  width: 140px;
}

.backup-stats-col-actions {
  width: 110px;
}

.backup-stats-device-cell,
.backup-stats-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.backup-stats-message {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  max-height: 2.8em;
  overflow: hidden;
}

.log-tail-panel {
  display: grid;
  gap: 12px;
}

.log-meta,
.log-files {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-files {
  color: var(--muted);
  font-size: 12px;
}

.log-lines {
  background: #111827;
  border-radius: 8px;
  color: #f9fafb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  max-height: 68vh;
  overflow: auto;
  padding: 12px;
}

.log-line {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(100px, 140px) minmax(0, 1fr);
  min-width: 760px;
  padding: 2px 0;
}

.log-line-source {
  color: #98a2b3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-line code {
  color: inherit;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.log-level-debug code {
  color: #d0d5dd;
}

.log-level-info code {
  color: #f9fafb;
}

.log-level-warning code {
  color: #fdb022;
}

.log-level-error code,
.log-level-critical code {
  color: #f97066;
}

pre {
  background: #111827;
  border-radius: 8px;
  color: #f9fafb;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.script-block {
  display: grid;
  gap: 10px;
}

.script-block-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.script-block-header p {
  margin: 6px 0 0;
}

.script-block-header button {
  flex: 0 0 auto;
  justify-self: start;
}

.script-textarea {
  background: #111827;
  color: #f9fafb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  max-width: 100%;
  min-height: 420px;
  min-width: 0;
  overflow: auto;
  resize: vertical;
  white-space: pre;
}

.script-textarea.compact {
  min-height: 280px;
}

.script-textarea.tall {
  min-height: 520px;
}

.backup-diff-pre {
  max-height: calc(100vh - 220px);
  min-height: min(520px, calc(100vh - 220px));
  overscroll-behavior: contain;
  padding: 10px 0;
  white-space: pre;
}

.backup-diff-modal-card {
  width: min(1100px, calc(100vw - 56px));
}

.backup-diff-line {
  display: block;
  min-height: 1.35em;
  padding: 0 12px;
}

.backup-diff-line.is-added {
  background: #063c2f;
  color: #b7f7cf;
}

.backup-diff-line.is-removed {
  background: #4a1519;
  color: #ffd1d1;
}

.backup-diff-line.is-hunk {
  background: #1f2937;
  color: #bfdbfe;
  font-weight: 800;
}

.backup-diff-line.is-header {
  background: #111827;
  color: #facc15;
  font-weight: 800;
}

.backup-diff-line.is-context {
  color: #e5e7eb;
}

.backup-diff-line.is-truncated {
  background: #312e81;
  color: #ddd6fe;
  font-weight: 800;
}

.enrollment-result {
  margin-top: 18px;
  max-width: 1040px;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form {
  margin: 0;
}

button,
.button {
  --button-focus-ring: rgba(15, 118, 110, 0.24);
  --button-progress-color: rgba(255, 255, 255, 0.72);
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  gap: 7px;
  min-height: 38px;
  overflow: hidden;
  padding: 8px 12px;
  position: relative;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    filter 140ms ease,
    transform 120ms ease;
}

button::after,
.button::after {
  animation: none;
  background: linear-gradient(90deg, transparent, var(--button-progress-color), transparent);
  bottom: 0;
  content: "";
  height: 2px;
  left: -45%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: -45%;
  transform: translateX(-55%);
}

button:hover:not(:disabled),
.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  text-decoration: none;
}

button:focus-visible,
.button:focus-visible {
  box-shadow: 0 0 0 3px var(--button-focus-ring);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

button:active:not(:disabled),
.button:active {
  filter: brightness(0.96);
  transform: translateY(1px) scale(0.985);
}

button.secondary,
.button.secondary {
  --button-progress-color: rgba(15, 118, 110, 0.55);
  background: #ffffff;
  border-color: #c8d0da;
  color: var(--text);
}

button.secondary:hover:not(:disabled),
.button.secondary:hover {
  background: #f8fafc;
  border-color: #98a2b3;
  color: var(--text);
}

button.small,
.button.small {
  font-size: 14px;
  min-height: 34px;
  padding: 6px 10px;
}

.icon-button {
  justify-content: center;
  min-width: 34px;
  padding: 6px;
}

button.danger,
.button.danger {
  --button-focus-ring: rgba(180, 35, 24, 0.22);
  background: var(--danger);
  border-color: var(--danger);
}

button.danger:hover:not(:disabled),
.button.danger:hover {
  background: #912018;
  border-color: #912018;
}

button.htmx-request,
.button.htmx-request,
form.htmx-request button[type="submit"] {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
  cursor: progress;
  filter: saturate(0.92);
}

button.htmx-request::after,
.button.htmx-request::after,
form.htmx-request button[type="submit"]::after {
  animation: button-pending-sweep 850ms ease-in-out infinite;
  opacity: 1;
}

button.danger.htmx-request,
.button.danger.htmx-request,
form.htmx-request button.danger[type="submit"] {
  border-color: #912018;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18);
}

@keyframes button-pending-sweep {
  from {
    transform: translateX(-55%);
  }

  to {
    transform: translateX(55%);
  }
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:disabled::after {
  animation: none;
  opacity: 0;
}

button.icon-button.danger,
.button.icon-button.danger {
  --button-progress-color: rgba(180, 35, 24, 0.5);
  background: #ffffff;
  border-color: #fecdca;
  color: var(--danger);
}

button.icon-button.danger:hover:not(:disabled),
.button.icon-button.danger:hover {
  background: #fff3f2;
  border-color: #fda29b;
  color: #912018;
}

@media (prefers-reduced-motion: reduce) {
  button,
  .button {
    transition: none;
  }

  button:active:not(:disabled),
  .button:active {
    transform: none;
  }

  button.htmx-request::after,
  .button.htmx-request::after,
  form.htmx-request button[type="submit"]::after {
    animation: none;
    transform: translateX(0);
  }
}

.pill {
  background: #eef1f5;
  border-radius: 999px;
  color: #344054;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.pill.is-success,
.pill.status-success {
  background: #dcfae6;
  color: #067647;
}

.pill.status-failed {
  background: #fee4e2;
  color: #b42318;
}

.pill.status-sent,
.pill.status-pending {
  background: #fef0c7;
  color: #b54708;
}

.pill.status-blocked {
  background: #e4e7ec;
  color: #344054;
}

.pill.is-muted {
  background: #eef1f5;
  color: var(--muted);
}

.pill.is-disabled {
  background: #e4e7ec;
  color: #475467;
}

.table tr.is-disabled-row td {
  background: #f8f9fb;
  color: #667085;
}

.split {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.entry-table {
  min-width: 720px;
}

.entry-table th,
.entry-table td {
  padding: 5px 8px;
  vertical-align: middle;
}

.entry-table code {
  line-height: 1.2;
}

.entry-table .pill {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 6px;
}

.entry-source-cell {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.entry-source-detail {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  max-width: min(560px, 46vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-table .entry-actions form {
  display: inline-flex;
}

.entry-table .icon-button {
  min-height: 26px;
  min-width: 26px;
  padding: 3px;
}

.entry-table .icon-button svg {
  height: 14px;
  width: 14px;
}

.entry-actions {
  text-align: right;
  width: 1%;
}

.checkbox-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.checkbox-row input {
  min-height: auto;
  width: auto;
}

.compact-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
}

.compact-fieldset legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
  text-transform: uppercase;
}

.row-details {
  position: relative;
}

.row-details summary {
  list-style: none;
}

.row-details summary::-webkit-details-marker {
  display: none;
}

.row-details-body {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.14);
  display: grid;
  gap: 14px;
  margin-top: 8px;
  min-width: min(360px, 72vw);
  padding: 14px;
  position: absolute;
  right: 0;
  z-index: 20;
}

.monitor-admin-layout .table td {
  vertical-align: top;
}

.monitor-admin-layout .table-wrap {
  overflow: visible;
}

.monitors-table,
.monitors-table tbody,
.monitors-table tr,
.monitors-table td {
  display: block;
}

.monitors-table {
  min-width: 0;
}

.monitors-table thead {
  display: none;
}

.monitors-table tbody {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitors-table tr {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.monitors-table td {
  border-bottom: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(112px, 32%) minmax(0, 1fr);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 5px 0;
}

.monitors-table td::before {
  color: var(--muted);
  content: attr(data-label);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.monitors-table td > * {
  grid-column: 2;
  justify-self: start;
  max-width: 100%;
  min-width: 0;
}

.monitors-table .truncate-code {
  max-width: 100%;
}

.monitors-table td.empty-state {
  display: block;
  padding: 10px;
}

.monitors-table td.empty-state::before {
  content: none;
}

.monitors-table td[data-label="Действия"] {
  align-items: center;
}

.monitors-table .actions {
  justify-content: flex-start;
}

.checkbox-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 0;
  padding: 12px;
}

.checkbox-grid legend {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 6px;
}

.monitor-group-picker {
  max-height: 280px;
  overflow: auto;
}

.copy-field {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.copy-field input {
  min-width: 0;
}

.monitor-detail-layout {
  grid-template-columns: minmax(0, 1fr);
}

.monitor-facts {
  margin-top: 14px;
}

.monitor-body {
  background: #0e1116;
  color: #f8fafc;
  min-height: 100vh;
  min-height: 100dvh;
}

.monitor-shell {
  align-content: start;
  display: grid;
  gap: 18px;
  grid-template-rows: auto auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
}

.monitor-header {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-width: 0;
}

.monitor-header h1 {
  color: #ffffff;
  font-size: clamp(1.45rem, 2.6vw, 3rem);
  line-height: 0.95;
  margin: 0;
  overflow-wrap: anywhere;
}

.monitor-kicker {
  color: #a7b0bf;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.monitor-dashboard-status {
  align-content: start;
  display: grid;
  gap: 18px;
}

.monitor-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.monitor-stat {
  align-items: center;
  background: #161b23;
  border: 1px solid #303948;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
  padding: 12px;
}

.monitor-stat span {
  color: #a7b0bf;
  font-size: 0.82rem;
  font-weight: 700;
}

.monitor-stat strong {
  color: #ffffff;
  font-size: clamp(1.2rem, 2vw, 2.1rem);
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: right;
}

.monitor-stat.is-online {
  border-color: #179b70;
}

.monitor-stat.is-offline,
.monitor-stat.is-failed {
  border-color: #dc4c42;
}

.monitor-stat.is-never-seen {
  border-color: #8b949e;
}

.monitor-stat.is-blocked {
  border-color: #e0a127;
}

.monitor-stat.is-disabled {
  border-color: #8b949e;
}

.monitor-updated-at {
  grid-column: span 2;
}

.monitor-updated-at strong {
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
}

.monitor-groups {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.monitor-group-card {
  background: #161b23;
  border: 1px solid #303948;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
}

.monitor-group-card.is-expanded {
  border-color: #dc4c42;
  align-items: flex-start;
  display: flex;
  flex-wrap: nowrap;
  grid-column: 1 / -1;
  overflow: hidden;
}

.monitor-group-card.is-disabled {
  background: #121821;
  border-color: #485465;
}

.monitor-group-summary {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.monitor-group-card.is-expanded .monitor-group-summary {
  flex: 0 0 280px;
  grid-template-columns: minmax(0, 1fr);
  max-width: 300px;
}

.monitor-group-title {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.monitor-group-title h2 {
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1.1;
  margin: 0;
  overflow-wrap: anywhere;
}

.monitor-group-title span {
  color: #a7b0bf;
}

.monitor-group-status {
  border-radius: 999px;
  flex: 0 0 auto;
  height: 13px;
  width: 13px;
}

.monitor-group-status.is-ok {
  background: #19b37b;
  box-shadow: 0 0 0 4px rgba(25, 179, 123, 0.16);
}

.monitor-group-status.has-problems {
  background: #ef5b4f;
  box-shadow: 0 0 0 4px rgba(239, 91, 79, 0.16);
}

.monitor-group-status.is-disabled {
  background: #8b949e;
  box-shadow: 0 0 0 4px rgba(139, 148, 158, 0.16);
}

.monitor-group-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-start;
}

.monitor-group-card.is-expanded .monitor-group-metrics {
  justify-content: flex-start;
}

.monitor-group-pull {
  color: #a7b0bf;
  display: grid;
  font-size: 0.92rem;
  gap: 3px;
  text-align: left;
}

.monitor-group-card.is-expanded .monitor-group-pull {
  text-align: left;
}

.monitor-group-pull b {
  color: #f8fafc;
}

.monitor-problem-row {
  display: flex;
  flex: 1 1 620px;
  flex-wrap: nowrap;
  gap: 10px;
  overflow: hidden;
}

.monitor-group-card.is-expanded .monitor-problem-row {
  min-width: min(100%, 620px);
}

.monitor-device-card {
  background: #0f141b;
  border: 1px solid #303948;
  border-left-width: 4px;
  border-radius: 8px;
  display: grid;
  flex: 0 0 300px;
  gap: 8px;
  min-width: 300px;
  padding: 12px;
}

.monitor-device-card.is-online {
  border-left-color: #19b37b;
}

.monitor-device-card.is-online .status-dot {
  background: #19b37b;
}

.monitor-device-card.is-offline {
  border-left-color: #ef5b4f;
}

.monitor-device-card.is-offline .status-dot {
  background: #ef5b4f;
}

.monitor-device-card.is-never-seen {
  border-left-color: #8b949e;
}

.monitor-device-card.is-never-seen .status-dot {
  background: #8b949e;
}

.monitor-device-card.is-blocked {
  border-left-color: #e0a127;
}

.monitor-device-card.is-blocked .status-dot {
  background: #e0a127;
}

.monitor-device-card.is-disabled {
  background: #121821;
  border-color: #3c4656;
  border-left-color: #8b949e;
}

.monitor-device-card.is-disabled .status-dot {
  background: #8b949e;
}

.monitor-device-card strong {
  color: #ffffff;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.monitor-device-card > span,
.monitor-device-line,
.monitor-device-facts {
  color: #a7b0bf;
}

.monitor-device-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.88rem;
  gap: 8px;
  justify-content: space-between;
}

.monitor-device-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.monitor-device-facts b {
  color: #f8fafc;
}

.monitor-empty {
  align-items: center;
  background: #161b23;
  border: 1px dashed #3c4656;
  border-radius: 8px;
  color: #a7b0bf;
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 160px;
  padding: 20px;
  text-align: center;
}

.flash.warning {
  border-color: #fedf89;
  color: var(--warn);
}

.flash.success {
  border-color: #a6f4c5;
  color: #027a48;
}

.flash.error {
  border-color: #fda29b;
  color: var(--danger);
}

.flash.danger {
  border-color: #fda29b;
  color: var(--danger);
}

.flash summary {
  cursor: pointer;
}

.flash pre {
  color: #f9fafb;
}

.flash-title {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.danger-zone {
  align-items: center;
  background: #fff7f5;
  border: 1px solid #fda29b;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px;
}

.danger-zone button {
  white-space: nowrap;
}

.token-detail {
  display: grid;
  gap: 18px;
}

.token-header {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px;
}

.token-heading {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.token-heading p {
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}

.token-kicker {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.token-status.is-active {
  background: #dcfae6;
  color: #067647;
}

.token-status.is-blocked {
  background: #fee4e2;
  color: #b42318;
}

.token-status.is-expired {
  background: #fef0c7;
  color: #93370d;
}

.token-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.token-metric {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
}

.token-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.token-metric strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.token-workspace {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}

.token-script-panel,
.token-facts-panel,
.token-danger-panel,
.token-table-panel {
  padding: 16px;
}

.token-script-panel {
  display: grid;
  gap: 14px;
}

.token-script-panel .script-textarea.compact {
  border-color: #1f2937;
  min-height: 440px;
}

.token-panel-title {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.token-panel-title h2,
.token-panel-title p {
  margin-bottom: 0;
}

.token-panel-title p {
  margin-top: 5px;
}

.token-panel-title button {
  flex: 0 0 auto;
}

.token-empty-script {
  background: #f8fafc;
  border: 1px dashed #c8d0da;
  border-radius: 8px;
}

.token-side-stack {
  display: grid;
  gap: 18px;
}

.token-facts {
  display: grid;
  gap: 0;
  margin: 0;
}

.token-facts div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 12px 0;
}

.token-facts div:first-child {
  border-top: 0;
  padding-top: 0;
}

.token-facts div:last-child {
  padding-bottom: 0;
}

.token-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.token-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.token-danger-panel {
  background: #fff7f5;
  border-color: #fda29b;
  display: grid;
  gap: 14px;
}

.token-danger-panel h2,
.token-danger-panel p {
  margin-bottom: 0;
}

.token-danger-panel p {
  margin-top: 6px;
}

.token-danger-actions,
.token-danger-actions form,
.token-danger-actions button {
  width: 100%;
}

.token-danger-actions button {
  justify-content: center;
  white-space: normal;
}

.token-table-panel {
  display: grid;
  gap: 14px;
}

.token-table {
  min-width: 720px;
}

.token-events-table {
  min-width: 980px;
}

.token-table th,
.token-table td {
  padding-bottom: 9px;
  padding-top: 9px;
}

@media (max-width: 760px) {
  .notification-progress-line {
    grid-template-columns: 1fr;
  }

  .notification-history-filters,
  .notification-incident-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 12px 18px;
  }

  .brand {
    white-space: normal;
  }

  .nav-disclosure {
    display: grid;
    flex: none;
    gap: 6px;
    width: 100%;
  }

  .nav-summary {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .nav {
    display: none;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    overflow: visible;
    padding: 0;
    width: 100%;
  }

  .nav-disclosure.is-open .nav {
    display: flex;
  }

  .nav a {
    flex: 1 1 calc(50% - 6px);
    padding: 6px 9px;
    text-align: center;
  }

  .user-menu {
    flex: none;
    justify-content: space-between;
    margin-left: 0;
    width: 100%;
  }

  .user-menu form {
    margin-left: 0;
  }

  .user-menu-text {
    text-align: right;
  }

  .main {
    padding: 18px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .workspace-grid,
  .group-editor-grid,
  .list-editor-grid,
  .form-grid.two,
  .schedule-controls,
  .group-assignment-form,
  .group-device-filter-bar,
  .group-device-filter-form,
  .worker-history-header,
  .worker-history-filter-form,
  .script-assignment-form,
  .routeros-update-form,
  .url-source-form,
  .asn-source-form,
  .device-filter-form,
  .token-linked-fields,
  .entry-filter-form,
  .log-filter-form {
    grid-template-columns: 1fr;
  }

  .mobile-card-table {
    min-width: 0;
    table-layout: fixed;
  }

  .mobile-card-table,
  .mobile-card-table thead,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table th,
  .mobile-card-table td {
    display: block;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 8px;
  }

  .monitors-table tbody {
    grid-template-columns: 1fr;
  }

  .mobile-card-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 10px;
  }

  .mobile-card-table tr.is-disabled-row {
    background: #f8f9fb;
    color: #667085;
  }

  .mobile-card-table tr.is-attention-row {
    background: #fff7f5;
  }

  .mobile-card-table td {
    border-bottom: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 0;
  }

  .mobile-card-table td > * {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
    min-width: 0;
  }

  .table.mobile-card-table tr.is-disabled-row td,
  .table.mobile-card-table tr.is-attention-row td {
    background: transparent;
  }

  .mobile-card-table td[data-label] {
    text-align: left;
    width: auto;
  }

  .mobile-card-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .mobile-card-table td.empty-state {
    display: block;
    padding: 10px;
  }

  .mobile-card-table td.empty-state::before {
    content: none;
  }

  .mobile-card-table td[data-label="Действия"] {
    align-items: center;
  }

  .mobile-card-table td[data-label="Действия"] > .button,
  .mobile-card-table td[data-label="Действия"] > button {
    justify-self: start;
  }

  .mobile-card-table td[data-label="Действия"] .actions,
  .mobile-card-table td[data-label="Действия"] .inline-form {
    justify-content: flex-start;
  }

  .summary-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-metrics-grid div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0;
  }

  .summary-metrics-grid div:first-child,
  .summary-metrics-grid div:nth-child(2) {
    border-top: 0;
    padding-top: 0;
  }

  .device-detail-page .summary-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-detail-page .summary-metrics-grid div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0;
  }

  .device-detail-page .summary-metrics-grid div:first-child,
  .device-detail-page .summary-metrics-grid div:nth-child(2) {
    border-top: 0;
    padding-top: 0;
  }

  .device-page-title {
    align-items: flex-start;
  }

  .device-identity-line {
    max-width: 100%;
  }

  .device-tabs {
    border-bottom: 0;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
  }

  .device-tabs .group-tab {
    border-color: var(--line);
    border-radius: 6px;
    margin-bottom: 0;
    min-height: 34px;
    padding: 6px 10px;
  }

  .device-tabs .group-tab.is-active {
    border-bottom-color: var(--line);
  }

  .device-overrides-panel .actions {
    grid-template-columns: 1fr;
  }

  .device-overrides-table,
  .device-effective-table {
    min-width: 0;
    table-layout: fixed;
  }

  .device-overrides-table,
  .device-overrides-table thead,
  .device-overrides-table tbody,
  .device-overrides-table tr,
  .device-overrides-table th,
  .device-overrides-table td,
  .device-effective-table,
  .device-effective-table thead,
  .device-effective-table tbody,
  .device-effective-table tr,
  .device-effective-table th,
  .device-effective-table td {
    display: block;
  }

  .device-overrides-table thead,
  .device-effective-table thead {
    display: none;
  }

  .device-overrides-table tbody,
  .device-effective-table tbody {
    display: grid;
    gap: 8px;
  }

  .device-overrides-table tr,
  .device-effective-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px 10px;
    padding: 10px;
  }

  .device-overrides-table tr {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .device-effective-table tr {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .device-overrides-table td,
  .device-effective-table td {
    border-bottom: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .device-overrides-table td:first-child,
  .device-effective-table td:first-child {
    color: var(--text);
    font-weight: 700;
  }

  .device-overrides-table td:nth-child(2) {
    grid-column: 1;
  }

  .device-overrides-table td:last-child {
    align-self: center;
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    overflow: visible;
    text-align: right;
    width: auto;
  }

  .device-overrides-table td:last-child .inline-form {
    display: flex;
  }

  .device-effective-table td:nth-child(2) {
    align-self: start;
    color: var(--text);
    font-weight: 800;
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .device-effective-table td:nth-child(3) {
    color: var(--muted);
    font-size: 13px;
    grid-column: 1 / -1;
  }

  .danger-panel {
    grid-template-columns: 1fr;
  }

  .danger-panel form,
  .danger-panel button {
    width: 100%;
  }

  .table.key-value-table,
  .table.key-value-table tbody,
  .table.key-value-table tr,
  .table.key-value-table th,
  .table.key-value-table td {
    display: block;
    width: 100%;
  }

  .table.key-value-table tr {
    border-bottom: 1px solid var(--line);
    padding: 7px 0;
  }

  .table.key-value-table th,
  .table.key-value-table td {
    border-bottom: 0;
    padding: 0;
  }

  .table.key-value-table td {
    margin-top: 4px;
  }

  .group-tabs {
    border-bottom: 0;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
  }

  .group-tabs .group-tab {
    border-color: var(--line);
    border-radius: 6px;
    margin-bottom: 0;
    min-height: 34px;
    padding: 6px 10px;
  }

  .group-tabs .group-tab.is-active {
    border-bottom-color: var(--line);
  }

  .group-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-summary-grid div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0;
  }

  .group-summary-grid div:first-child,
  .group-summary-grid div:nth-child(2) {
    border-top: 0;
    padding-top: 0;
  }

  .assigned-lists-table {
    min-width: 0;
    table-layout: fixed;
  }

  .assigned-lists-table,
  .assigned-lists-table thead,
  .assigned-lists-table tbody,
  .assigned-lists-table tr,
  .assigned-lists-table th,
  .assigned-lists-table td {
    display: block;
  }

  .assigned-lists-table thead {
    display: none;
  }

  .assigned-lists-table tbody {
    display: grid;
    gap: 8px;
  }

  .assigned-lists-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px 10px;
    grid-template-columns: minmax(0, 1fr) 34px;
    padding: 10px;
  }

  .assigned-lists-table td {
    border-bottom: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .assigned-lists-table td:first-child {
    color: var(--text);
    font-weight: 700;
  }

  .assigned-lists-table td:nth-child(2) {
    color: var(--muted);
    font-size: 13px;
    grid-column: 1;
  }

  .assigned-lists-table td:last-child {
    align-self: center;
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    overflow: visible;
    width: auto;
  }

  .truncate-code {
    max-width: 72vw;
  }

  .page-title {
    display: grid;
  }

  .split {
    display: grid;
  }

  .split button,
  .split .button {
    justify-content: center;
    width: 100%;
  }

  .list-rebuild-panel {
    align-items: stretch;
    display: grid;
  }

  .list-rebuild-panel form,
  .list-rebuild-panel button {
    width: 100%;
  }

  .list-collapse-summary {
    grid-template-columns: 1fr;
  }

  .list-card-overview,
  .list-card-pills {
    justify-content: flex-start;
    justify-items: start;
  }

  .list-card-note {
    text-align: left;
  }

  .users-row-details {
    gap: 10px;
  }

  .modal-layer {
    padding: 18px;
  }

  .modal-card,
  .users-modal-card {
    max-height: calc(100vh - 36px);
    width: calc(100vw - 36px);
  }

  .dashboard-group-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-group-overview,
  .dashboard-group-pills,
  .dashboard-group-pull-summary {
    justify-content: flex-start;
    justify-items: start;
  }

  .device-status-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .device-status-popover {
    width: min(320px, calc(100vw - 36px));
  }

  .token-header {
    display: grid;
    padding: 16px;
  }

  .page-actions,
  .page-actions a,
  .page-actions form,
  .page-actions button {
    width: 100%;
  }

  .script-block-header {
    display: grid;
  }

  .log-line {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .log-line-source {
    white-space: normal;
  }

  .danger-zone {
    display: grid;
  }

  .danger-zone .actions,
  .danger-zone form,
  .danger-zone button {
    width: 100%;
  }

  .token-metrics,
  .token-workspace {
    grid-template-columns: 1fr;
  }

  .token-panel-title {
    display: grid;
  }

  .token-panel-title button,
  .token-danger-actions,
  .token-danger-actions form,
  .token-danger-actions button {
    width: 100%;
  }

  .script-textarea,
  .script-textarea.compact,
  .script-textarea.tall {
    min-height: 300px;
  }

  .row-details-body {
    min-width: min(340px, calc(100vw - 36px));
    right: auto;
  }

  .copy-field {
    grid-template-columns: 1fr;
  }

  .monitor-shell {
    padding: 14px;
  }

  .monitor-header {
    align-items: stretch;
    display: grid;
  }

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

  .monitor-updated-at {
    grid-column: 1 / -1;
  }

  .monitor-groups {
    grid-template-columns: 1fr;
  }

  .monitor-group-summary {
    grid-template-columns: 1fr;
  }

  .monitor-group-card.is-expanded .monitor-group-summary {
    flex-basis: auto;
    grid-template-columns: 1fr;
    max-width: none;
  }

  .monitor-group-card.is-expanded {
    display: grid;
    grid-column: auto;
    overflow: visible;
  }

  .monitor-group-metrics {
    justify-content: flex-start;
  }

  .monitor-group-card.is-expanded .monitor-group-metrics {
    justify-content: flex-start;
  }

  .monitor-group-pull {
    text-align: left;
  }

  .monitor-group-card.is-expanded .monitor-group-pull {
    text-align: left;
  }

  .monitor-problem-row {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .monitor-group-card.is-expanded .monitor-problem-row {
    min-width: 0;
  }

  .monitor-device-card {
    min-width: 0;
  }
}
