:root {
  color-scheme: dark;
  --bg: #101317;
  --panel: #171c22;
  --panel-2: #1d242c;
  --text: #edf2f8;
  --muted: #9ba7b4;
  --line: #303946;
  --accent: #5fb3ff;
  --ok: #37c978;
  --warn: #f3b341;
  --bad: #f06b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", "Inter", Arial, sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #0d1014;
}

.brand {
  margin: 4px 8px 18px;
  font-size: 20px;
  font-weight: 700;
}

nav {
  display: grid;
  gap: 4px;
}

nav a {
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

nav a:hover {
  background: var(--panel-2);
}

.plain-link {
  color: inherit;
  text-decoration: none;
}

.plain-link:hover {
  color: var(--accent);
}

.sidebar-form {
  display: grid;
  gap: 8px;
  margin: 18px 8px 0;
}

.account-page {
  max-width: 600px;
}

.account-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 20px;
  margin: 0 0 24px;
}

.account-identity dt {
  color: var(--muted);
}

.account-identity dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.account-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.form-grid.account-password-form,
.form-grid.user-password-reset {
  grid-template-columns: minmax(0, 1fr);
}

.user-password-reset {
  width: min(420px, 100%);
}

.user-delete-action {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.page {
  margin-left: 232px;
  min-width: 0;
  padding: 22px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
}

.login-panel {
  width: min(500px, 100%);
}

.auth-provider-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  background: #101820;
}

.auth-provider-option {
  display: block !important;
  cursor: pointer;
}

.auth-provider-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.auth-provider-option span {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.auth-provider-option input:checked + span {
  border-color: #3d8ed5;
  background: #15324b;
  color: var(--text);
}

.auth-provider-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login-help {
  line-height: 1.35;
}

.directory-auth-form {
  display: grid;
  gap: 14px;
}

.directory-auth-form .panel + .panel,
.directory-auth-form .panel + .auth-advanced,
.directory-auth-form .auth-advanced + .panel {
  margin-top: 0;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading p,
.section-note {
  max-width: 920px;
}

.switchline {
  flex: 0 0 auto;
  min-height: 34px;
}

.form-grid.auth-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.auth-role-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.auth-policy-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr)) minmax(180px, 0.5fr);
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.auth-policy-row > label:not(.checkline) {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.auth-advanced summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.auth-advanced[open] summary {
  margin-bottom: 10px;
}

.auth-advanced p {
  margin-bottom: 12px;
}

.auth-save-actions {
  justify-content: flex-end;
}

.form-grid.auth-test-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  margin-top: 12px;
}

.auth-test-result {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

@media (max-width: 1100px) {
  .form-grid.auth-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-policy-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid.auth-settings-grid,
  .form-grid.auth-role-grid,
  .form-grid.auth-test-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-provider-switch {
    grid-template-columns: 1fr;
  }
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  margin-bottom: 12px;
  font-size: 16px;
}

p,
.muted,
small {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

.job-metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.metric,
.panel,
.left-pane,
.right-pane {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric {
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
}

.metric .chip {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  font-size: 13px;
  line-height: 1;
  vertical-align: middle;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.metric.compact strong {
  font-size: 22px;
}

.metric.compact strong:has(.chip) {
  line-height: 1;
}

.actuality-page .metric.compact .chip {
  min-height: 22px;
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1.05;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(480px, 1.4fr);
  gap: 14px;
  align-items: start;
}

.left-pane,
.right-pane,
.panel {
  padding: 14px;
}

.panel + .panel,
.panel + .workbench,
.workbench + .panel,
.panel + .advanced-panel,
.advanced-panel + .panel {
  margin-top: 14px;
}

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

.advanced-panel summary {
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.advanced-panel[open] summary {
  margin-bottom: 12px;
}

.settings-foldout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
}

.settings-foldout + .settings-foldout {
  margin-top: 10px;
}

.settings-foldout summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.settings-foldout[open] summary {
  margin-bottom: 12px;
}

.right-pane {
  display: grid;
  gap: 14px;
}

.list {
  display: grid;
  gap: 6px;
}

.list-row,
.job-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #2a3440;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

.chip.online,
.chip.active,
.chip.ok,
.chip.succeeded,
.chip.success {
  color: var(--ok);
}

.chip.pending,
.chip.key_changed,
.chip.busy,
.chip.assigned,
.chip.running,
.chip.cancel_requested {
  color: var(--warn);
}

.chip.rejected,
.chip.offline,
.chip.failed,
.chip.critical {
  color: var(--bad);
}

.chip.warning,
.chip.warn,
.chip.skipped,
.chip.unknown {
  color: var(--warn);
}

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

.chip.info {
  color: var(--accent);
}

.event-stack {
  display: grid;
  gap: 6px;
}

.event-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.actuality-page .event-stack {
  gap: 8px;
}

.actuality-page .event-line {
  gap: 8px 10px;
  padding: 9px 10px;
  border: 1px solid rgba(55, 74, 93, 0.62);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.actuality-page .event-line strong {
  min-width: 120px;
}

.actuality-page .event-line span:not(.chip),
.actuality-page .event-line small {
  overflow-wrap: anywhere;
}

.actuality-page .event-line small {
  color: var(--muted);
}

.actuality-page .event-line form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.actuality-page .event-line input {
  width: min(180px, 100%);
  min-width: 0;
}

.actuality-page .event-line button {
  min-height: 32px;
  padding: 5px 10px;
}

.notification-event-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.notification-event-main {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  gap: 7px 10px;
}

.notification-message,
.notification-error {
  grid-column: 1;
  min-width: 0;
}

.notification-message {
  font-weight: 700;
}

.notification-event-action {
  grid-column: 2;
  grid-row: 1 / span 3;
  justify-self: end;
}

.monitor-settings-list {
  display: grid;
  gap: 12px;
}

.monitor-settings-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.monitor-settings-card.ok { border-left-color: var(--ok); }
.monitor-settings-card.warning,
.monitor-settings-card.unknown { border-left-color: var(--warn); }
.monitor-settings-card.critical { border-left-color: var(--bad); }
.monitor-settings-card.disabled { border-left-color: var(--muted); }

.monitor-settings-head,
.monitor-settings-title,
.monitor-settings-actions,
.monitor-layer-main,
.monitor-layer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.monitor-settings-head {
  justify-content: space-between;
}

.monitor-settings-title strong,
.monitor-layer-main strong {
  font-size: 15px;
}

.monitor-settings-title small,
.monitor-layer-main small,
.monitor-layer-state small {
  color: var(--muted);
}

.monitor-settings-actions,
.monitor-layer-actions {
  justify-content: flex-end;
}

.monitor-settings-actions form,
.monitor-layer-actions form {
  margin: 0;
}

.monitor-settings-actions button,
.monitor-settings-actions .button-link,
.monitor-layer-actions button {
  min-height: 32px;
  padding: 5px 10px;
}

.monitor-settings-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
}

.monitor-settings-meta span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(55, 74, 93, 0.62);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.016);
}

.monitor-settings-meta small {
  color: var(--muted);
}

.monitor-settings-meta strong,
.monitor-layer-state span,
.monitor-layer-state small {
  overflow-wrap: anywhere;
}

.monitor-settings-layers {
  display: grid;
  gap: 8px;
}

.monitor-layer-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.9fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(55, 74, 93, 0.62);
  border-radius: 6px;
  background: #121922;
}

.monitor-layer-row.critical { border-color: rgba(240, 107, 107, 0.5); }
.monitor-layer-row.warning { border-color: rgba(243, 179, 65, 0.45); }
.monitor-layer-row.ok { border-color: rgba(58, 201, 139, 0.35); }
.monitor-layer-row.disabled { opacity: 0.76; }

.monitor-layer-main {
  min-width: 0;
}

.monitor-layer-main small {
  flex-basis: 100%;
  overflow-wrap: anywhere;
}

.monitor-layer-state {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.layer-index {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
}

.freshness-list {
  display: grid;
  gap: 10px;
}

.freshness-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 7px;
}

.actuality-page .freshness-card-grid > .empty {
  grid-column: 1 / -1;
}

.freshness-row,
.freshness-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--panel-2);
}

.freshness-card {
  align-content: start;
  min-height: 96px;
  overflow: hidden;
}

.freshness-card .freshness-title {
  display: grid;
  gap: 4px;
}

.freshness-card .freshness-title .chip {
  width: max-content;
  max-width: 100%;
}

.freshness-card .mini-layer-list {
  display: none;
}

.freshness-card-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.freshness-card-link:hover,
.freshness-card-link:focus-visible {
  border-color: rgba(95, 179, 255, 0.7);
  background: color-mix(in srgb, var(--panel-2) 86%, var(--accent) 14%);
  outline: none;
}

.freshness-row.critical,
.freshness-card.critical {
  border-color: rgba(240, 107, 107, 0.55);
}

.freshness-row.warning,
.freshness-row.unknown,
.freshness-card.warning,
.freshness-card.unknown {
  border-color: rgba(243, 179, 65, 0.5);
}

.freshness-head {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
}

.freshness-title {
  display: flex;
  width: 100%;
  max-width: 100%;
  align-items: start;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

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

.freshness-title strong,
.freshness-title small,
.freshness-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.freshness-title small,
.freshness-meta small,
.layer-node small {
  display: block;
}

.freshness-title .chip {
  flex: 0 0 auto;
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 21px;
  padding: 3px 8px;
  font-size: 12px;
}

.freshness-title strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.freshness-title small,
.freshness-meta small {
  font-size: 12px;
  line-height: 1.25;
}

.freshness-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px 10px;
  min-width: 0;
}

.freshness-meta.flat {
  justify-content: flex-start;
}

.freshness-meta.flat small {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
}

.layer-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.layer-strip.compact {
  flex-wrap: wrap;
  overflow-x: visible;
}

.detail-layers {
  align-items: flex-start;
  padding-bottom: 4px;
}

.layer-node {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 210px;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121922;
}

.detail-layers .layer-node {
  flex: 0 0 260px;
  width: 260px;
  min-width: 260px;
  min-height: 164px;
  height: auto;
  gap: 3px;
  padding: 8px;
  overflow: visible;
}

.layer-strip.compact .layer-node {
  min-width: 180px;
  flex: 1 1 180px;
}

.layer-node.ok {
  border-color: rgba(55, 201, 120, 0.45);
}

.layer-node.warning,
.layer-node.running,
.layer-node.skipped,
.layer-node.unknown {
  border-color: rgba(243, 179, 65, 0.45);
}

.layer-node.critical {
  border-color: rgba(240, 107, 107, 0.55);
}

.layer-node.blocked,
.layer-node.blocked_waiting {
  border-color: rgba(240, 107, 107, 0.55);
}

.layer-node.active {
  border-color: rgba(95, 179, 255, 0.7);
}

.layer-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.layer-node-head .chip {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 9px;
  line-height: 1.1;
}

.layer-reason {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.22;
}

.detail-layers .layer-node > strong,
.detail-layers .layer-node small,
.detail-layers .layer-reason {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-layers .layer-node > strong {
  font-size: 14px;
  line-height: 1.18;
}

.detail-layers .layer-node small {
  font-size: 12px;
  line-height: 1.18;
}

.detail-layers .layer-node .layer-size {
  white-space: normal;
  overflow-wrap: anywhere;
}

.detail-layers .layer-path,
.detail-layers .layer-observation,
.detail-layers .layer-job {
  color: var(--muted);
}

.layer-arrow {
  display: inline-flex;
  flex: 0 0 auto;
  white-space: nowrap;
  align-self: center;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.monitoring-dashboard-bar {
  display: grid;
  gap: 10px;
}

.actuality-overview-header {
  align-items: center;
  margin-bottom: 10px;
}

.actuality-overview-header h1 {
  font-size: 24px;
  line-height: 1.15;
}

.actuality-overview-header p {
  margin-top: 2px;
  line-height: 1.25;
}

.actuality-page .monitoring-dashboard-bar {
  gap: 8px;
  padding: 10px 12px;
}

.actuality-page .monitoring-dashboard-bar .panel-toolbar {
  align-items: center;
  margin-bottom: 4px;
}

.actuality-page .monitoring-dashboard-bar h2 {
  margin-bottom: 2px;
}

.actuality-page .monitoring-dashboard-bar .compact-foldout {
  width: auto;
  min-width: 190px;
  padding: 7px 10px;
}

.actuality-page .monitoring-dashboard-bar .compact-foldout[open] {
  width: min(620px, 100%);
}

.actuality-page .actuality-overview-metrics {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.actuality-page .metric.compact {
  padding: 9px 11px;
}

.actuality-page .metric.compact strong {
  margin-top: 1px;
  font-size: 20px;
}

.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.monitoring-health-reason {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.4;
  border-radius: 6px;
}

.chain-rule-card {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.chain-rule-card.ok { border-left-color: var(--ok); }
.chain-rule-card.warning,
.chain-rule-card.running,
.chain-rule-card.unknown { border-left-color: var(--warn); }
.chain-rule-card.critical { border-left-color: var(--bad); }
.chain-rule-card.disabled { border-left-color: var(--muted); }

.chain-rule-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
}

.chain-rule-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(55, 74, 93, 0.68);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.016);
}

.chain-rule-summary strong,
.chain-rule-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-rule-summary small {
  color: var(--muted);
}

.backup-set-summary strong,
.backup-set-summary small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.chain-settings-foldout {
  padding: 8px 10px;
}

.compact-foldout {
  width: min(620px, 100%);
}

.compact-form {
  margin-top: 10px;
}

.monitoring-widget-grid {
  --dashboard-gap: 8px;
  --dashboard-cell-min: 152px;
  display: grid;
  width: 100%;
  max-width: var(--dashboard-max-width, 100%);
  grid-template-columns: repeat(auto-fill, minmax(var(--dashboard-cell-min), 1fr));
  grid-auto-flow: dense;
  align-items: start;
  justify-content: start;
  gap: var(--dashboard-gap);
  border-radius: 8px;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.monitoring-widget-grid.drag-grid-visible {
  background-color: rgba(95, 179, 255, 0.035);
  background-image:
    linear-gradient(rgba(95, 179, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 179, 255, 0.34) 1px, transparent 1px);
  background-size: 144px 77px;
  background-position: 0 0;
  box-shadow: inset 0 0 0 1px rgba(95, 179, 255, 0.36);
}

.dashboard-kiosk {
  overflow-x: hidden;
  overflow-y: auto;
  background: #0b1016;
}

.dashboard-kiosk .sidebar {
  display: none;
}

.dashboard-kiosk .page {
  width: 100%;
  min-height: 100vh;
  margin-left: 0;
  padding: 12px;
}

.dashboard-kiosk .monitoring-widget-grid {
  margin: 0;
}

.dashboard-kiosk-controls {
  position: fixed;
  z-index: 20;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0.025;
  transition: opacity 0.15s ease;
}

.dashboard-kiosk-controls:hover,
.dashboard-kiosk-controls:focus-within {
  opacity: 1;
}

.dashboard-kiosk-controls .button-link,
.dashboard-kiosk-controls button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
  background: rgba(14, 21, 30, 0.92);
}

.monitoring-widget {
  container-type: inline-size;
  grid-column: span 1;
  justify-self: start;
  align-self: start;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease, opacity 0.12s ease;
}

.monitoring-widget-link:hover,
.monitoring-widget-link:focus-visible {
  border-color: rgba(71, 162, 255, 0.72);
  background: color-mix(in srgb, var(--panel) 84%, var(--accent) 16%);
  outline: none;
}

.monitoring-widget.ok { border-left-color: var(--ok); }
.monitoring-widget.warning,
.monitoring-widget.running,
.monitoring-widget.unknown { border-left-color: var(--warn); }
.monitoring-widget.critical { border-left-color: var(--bad); }
.monitoring-widget.disabled { border-left-color: var(--muted); }

.monitoring-widget[data-widget-width="1"],
.monitoring-widget[data-widget-width="2"],
.monitoring-widget[data-widget-width="3"],
.monitoring-widget[data-widget-width="4"],
.monitoring-widget[data-widget-width="6"],
.monitoring-widget[data-widget-width="8"],
.monitoring-widget[data-widget-width="12"] { max-width: none; }

.monitoring-widget.dragging {
  opacity: 0.55;
  outline: 1px dashed var(--accent);
}

.monitoring-widget.widget-drop-target {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.monitoring-widget-grid.drag-saving .monitoring-widget {
  cursor: progress;
}

.monitoring-widget.drag-ready {
  cursor: grabbing;
  outline: 1px dashed rgba(95, 179, 255, 0.9);
  outline-offset: 2px;
}

.layer-node.dragging {
  opacity: 0.55;
}

.layer-node.drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

.monitoring-widget-head,
.monitoring-widget-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 5px;
}

.monitoring-widget-head {
  flex-wrap: nowrap;
}

.monitoring-widget-head > .chip {
  flex: 0 0 auto;
  padding: 4px 9px;
  font-size: 12px;
  line-height: 1.1;
}

.monitoring-widget-title,
.monitoring-widget-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.monitoring-widget-title strong {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 1.2;
}

.monitoring-widget-title a,
.monitoring-widget-title strong > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitoring-widget-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
}

.monitoring-widget-head small,
.monitoring-widget-body small,
.dashboard-stage small {
  color: var(--muted);
}

.summary-body {
  margin: 0;
}

.compact-chain-summary {
  display: none;
  margin: 0 0 auto;
}

.summary-body > strong,
.monitoring-widget-body > strong {
  font-size: 13px;
  line-height: 1.2;
}

.widget-status-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
}

.widget-status-line.ok { color: var(--ok); }
.widget-status-line.warning,
.widget-status-line.running,
.widget-status-line.unknown { color: var(--warn); }
.widget-status-line.critical { color: var(--bad); }
.widget-status-line.disabled { color: var(--muted); }

.widget-focus-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
}

.widget-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.widget-kpi-row > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(55, 74, 93, 0.78);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.widget-kpi-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-chain {
  flex: 1;
}

.dashboard-chain-compact {
  flex: 0 1 auto;
  align-items: stretch;
  gap: 5px;
  overflow: hidden;
}

.dashboard-stage {
  display: grid;
  min-width: 66px;
  align-content: start;
  gap: 1px;
  padding: 4px 5px;
  border-left: 3px solid var(--line);
  background: var(--panel-2);
}

.dashboard-chain-compact .dashboard-stage {
  flex: 1 1 66px;
  max-width: 96px;
}

.dashboard-stage strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
}

.dashboard-stage-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.15;
}

.dashboard-stage.ok .dashboard-stage-status { color: var(--ok); }
.dashboard-stage.warning .dashboard-stage-status,
.dashboard-stage.running .dashboard-stage-status,
.dashboard-stage.unknown .dashboard-stage-status { color: var(--warn); }
.dashboard-stage.critical .dashboard-stage-status { color: var(--bad); }

.dashboard-stage.ok { border-left-color: var(--ok); }
.dashboard-stage.warning,
.dashboard-stage.running,
.dashboard-stage.unknown { border-left-color: var(--warn); }
.dashboard-stage.critical { border-left-color: var(--bad); }

.mini-layer-list {
  display: grid;
  max-height: 42px;
  gap: 3px;
  margin-top: 0;
  overflow: hidden;
}

.mini-layer-list.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 0;
}

.mini-layer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.mini-layer span,
.mini-layer {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-layer i {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.mini-layer.ok i { background: var(--ok); }
.mini-layer.warning i,
.mini-layer.running i,
.mini-layer.unknown i { background: var(--warn); }
.mini-layer.critical i { background: var(--bad); }

@container (max-width: 420px) {
  .monitoring-widget {
    gap: 6px;
    padding: 8px 9px;
  }

  .monitoring-widget.mode-chain .dashboard-chain {
    display: flex;
    flex-wrap: wrap;
  }

  .monitoring-widget.mode-chain .layer-arrow {
    display: none;
  }

  .monitoring-widget.mode-chain .dashboard-stage {
    min-width: 96px;
    flex-basis: 96px;
  }
}

.monitoring-widget-footer {
  align-items: end;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.monitoring-widget-footer > .button-link {
  flex: 0 0 auto;
}

.monitoring-widget-probe-form {
  flex: 0 0 auto;
  margin: 0;
}

.monitoring-widget-probe-form button {
  min-height: 30px;
  padding: 5px 9px;
}

@container (max-width: 420px) {
  .monitoring-widget-head {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .monitoring-widget-title {
    flex: 1 1 auto;
  }

  .monitoring-widget-head > .chip {
    flex: 0 0 auto;
  }

  .monitoring-widget-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
  }

  .monitoring-widget-footer > .button-link,
  .monitoring-widget-probe-form,
  .monitoring-widget-probe-form button {
    width: 100%;
  }

  .monitoring-widget-footer > .button-link,
  .monitoring-widget-probe-form button {
    min-height: 32px;
    justify-content: center;
    padding: 5px 6px;
    font-size: 12px;
    white-space: nowrap;
  }
}

.monitoring-widget-edit-panel {
  display: none;
}

.monitoring-widget-editor-dock {
  margin-top: 14px;
}

.monitoring-widget-editor-dock[hidden] {
  display: none;
}

.monitoring-widget-editor-dock .monitoring-widget-edit-panel {
  display: grid;
  gap: 8px;
}

.monitoring-widget-editor-dock .panel-toolbar {
  margin-bottom: 10px;
}

.monitoring-widget-editor-body {
  display: grid;
  gap: 8px;
}

.monitoring-widget-editor-dock .monitoring-widget-layout-form {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
}

.monitoring-widget-layout-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(120px, 0.8fr) minmax(92px, 0.45fr) minmax(120px, 0.7fr) auto;
  gap: 7px;
  align-items: end;
}

.monitoring-widget-layout-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.monitoring-widget-layout-form input,
.monitoring-widget-layout-form select {
  width: 100%;
  min-width: 0;
}

.monitoring-widget-layout-form button,
.monitoring-widget-delete-form button {
  width: 100%;
}

.monitoring-widget-delete-form {
  margin: 0;
}

.layer-node-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  margin: auto 0 0;
}

.detail-layers .inline-form {
  display: block;
  width: 100%;
  margin: 0;
}

.detail-layers .inline-form button,
.detail-layers .layer-node-actions > .button-link {
  width: 100%;
  min-height: 28px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
  white-space: nowrap;
}

.monitoring-editor {
  max-width: 1120px;
}

.monitoring-editor > .link-form-tabs {
  margin-bottom: 16px;
}

.monitoring-editor .monitoring-tab-panel {
  border: 0;
  padding: 0;
}

.monitoring-editor .monitoring-tab-panel > legend {
  margin-bottom: 12px;
  padding: 0;
  color: var(--text);
  font-weight: 600;
}

.monitoring-editor form,
.monitoring-editor fieldset,
.monitoring-editor label,
.monitoring-editor [data-monitoring-inherited-threshold] {
  min-width: 0;
}

.monitoring-editor [data-monitoring-access] {
  display: contents;
}

.monitoring-editor input,
.monitoring-editor select,
.monitoring-editor textarea {
  max-width: 100%;
}

.monitoring-editor .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.monitoring-editor label {
  align-content: start;
}

@media (max-width: 700px) {
  .monitoring-editor .form-grid,
  .monitoring-editor fieldset {
    grid-template-columns: minmax(0, 1fr);
  }

  .actuality-page .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .actuality-page .page-header > div,
  .actuality-page .page-header h1 {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

.monitoring-editor [data-monitoring-inherited-threshold] {
  display: grid;
  gap: 10px;
  align-content: start;
}

.monitoring-layer-toolbar {
  margin: 12px 0;
}

.actuality-page .monitoring-linked-resource {
  overflow-wrap: anywhere;
}

.monitoring-copy-preview table {
  min-width: 660px;
  table-layout: fixed;
}

.monitoring-copy-preview td {
  overflow-wrap: anywhere;
}

.monitoring-copy-preview th:first-child {
  width: 40px;
}

.monitoring-copy-preview th:nth-child(4) {
  width: 30%;
}

.monitoring-copy-preview small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.monitoring-save-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.monitoring-editor-controls {
  margin-top: 16px;
}

.monitoring-layer-settings-table {
  min-width: 640px;
}

.monitoring-settings-table td:first-child,
.monitoring-layer-settings-table td {
  overflow-wrap: anywhere;
}

.connection-map {
  display: grid;
  gap: 10px;
}

.connection-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.connection-card.disabled {
  opacity: 0.72;
}

.connection-head,
.route-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.connection-head small {
  display: block;
}

.endpoint-box {
  display: grid;
  flex: 1;
  min-width: 220px;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121922;
}

.endpoint-box span {
  overflow-wrap: anywhere;
}

.route-arrow {
  display: grid;
  min-width: 130px;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

.route-arrow span {
  color: var(--accent);
  font-weight: 700;
}

.connection-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.connection-settings span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111820;
  color: var(--muted);
}

.link-edit,
.endpoint-edit,
.credential-edit,
.profile-edit {
  padding: 8px 0 0;
}

.link-edit summary,
.endpoint-edit summary,
.credential-edit summary,
.profile-edit summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.link-edit[open] summary,
.endpoint-edit[open] summary,
.credential-edit[open] summary,
.profile-edit[open] summary {
  margin-bottom: 10px;
}

.chain-list {
  display: grid;
  gap: 10px;
}

.copy-monitoring-section .chain-list,
.copy-monitoring-section .job-list,
.copy-monitoring-section .event-stack {
  max-height: min(560px, 70vh);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.chain-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.chain-card.failed,
.chain-card.cancelled {
  border-color: rgba(240, 107, 107, 0.55);
}

.chain-card.warning,
.chain-card.queued,
.chain-card.assigned,
.chain-card.running,
.chain-card.cancel_requested {
  border-color: rgba(243, 179, 65, 0.45);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.backup-selection-fields {
  margin: 0;
  min-width: 0;
}

.backup-file-set-table td:first-child {
  min-width: 160px;
  max-width: 420px;
  overflow-wrap: anywhere;
}

.backup-file-set-table td,
.backup-set-issue {
  overflow-wrap: anywhere;
}

.backup-file-set-table .chip {
  white-space: normal;
}

.backup-file-set-table .backup-file-size {
  min-width: 128px;
}

.backup-file-size small {
  display: block;
}

.backup-file-sets .table-scroll > table {
  display: table;
  min-width: 560px;
  white-space: normal;
}

.monitoring-profile-list .monitoring-settings-cell {
  width: 44px;
  padding: 4px;
}

.button-link.monitoring-settings-icon {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  flex: 0 0 32px;
  font-size: 17px;
}

.monitoring-profile-list .monitoring-number-cell {
  text-align: center;
}

.monitoring-profile-list td:first-child {
  min-width: 180px;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.monitoring-summary-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
  white-space: normal;
}

.monitoring-summary-reason {
  display: block;
  max-width: 320px;
  margin-top: 4px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.monitoring-pagination {
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.monitoring-dashboard-group {
  margin: 20px 0;
}

.monitoring-dashboard-group h2,
.monitoring-legacy-title {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.monitoring-dashboard-group .panel-toolbar {
  margin-bottom: 10px;
}

.monitoring-dashboard-actions {
  margin-top: 16px;
}

.monitoring-profile-widget-grid .monitoring-widget {
  height: 108px;
}

.monitoring-auto-dashboard {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  margin-top: 12px;
}

.user-group-options {
  max-height: 360px;
  overflow-y: auto;
}

.user-group-options .checkline {
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-group-delete {
  margin-top: 24px;
}

[data-department-dashboard] .monitoring-widget {
  cursor: default;
}

[data-department-pagination][hidden] {
  display: none;
}

.actuality-page .page-header > div {
  min-width: 0;
}

.actuality-page .page-header h1,
.actuality-page .page-header p,
.monitoring-delete-confirmation h2,
.monitoring-delete-confirmation p {
  overflow-wrap: anywhere;
}

.monitoring-chain-actions {
  margin-top: 16px;
}

.monitoring-profile-widget-grid .monitoring-widget-title strong > span {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.monitoring-profile-widget-grid .widget-focus-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitoring-profile-picker {
  border: 0;
  margin: 0;
  padding: 12px 0;
}

.monitoring-profile-options {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 10px;
}

.monitoring-profile-options .checkbox {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.monitoring-profile-options .checkbox[hidden] {
  display: none;
}

.monitoring-profile-options .checkbox span {
  overflow-wrap: anywhere;
}

.monitoring-profile-options small {
  white-space: nowrap;
}

.monitoring-profile-index {
  table-layout: fixed;
}

.monitoring-profile-index col:first-child {
  width: 32%;
}

.monitoring-profile-index col:nth-child(2) {
  width: 44px;
}

.monitoring-profile-index col:nth-child(3) {
  width: 80px;
}

.monitoring-profile-index col:last-child {
  width: 160px;
}

.audit-events td {
  overflow-wrap: anywhere;
}

.audit-events th:last-child,
.audit-events td:last-child {
  min-width: 100px;
  white-space: nowrap;
}

.audit-events .audit-actor {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.table-scroll > table {
  min-width: 720px;
}

.monitoring-history-filters {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) minmax(120px, .8fr) 144px 144px auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

.monitoring-history-filters label { min-width: 0; }
.monitoring-history-filters .button-row { flex-wrap: nowrap; }
.monitoring-history-table { table-layout: fixed; min-width: 860px; }
.monitoring-history-table .history-time-col { width: 152px; }
.monitoring-history-table .history-chain-col { width: 22%; }
.monitoring-history-table .history-result-col { width: 180px; }
.monitoring-history-table .history-action-col { width: 48px; }
.monitoring-history-table td { vertical-align: middle; }
.monitoring-history-table small { display: block; }
.history-chain strong, .history-chain small, .history-reason {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-reason { margin-top: 4px; }
.history-layer-paths { display: grid; gap: 6px; min-width: 0; }
.history-layer-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.history-layer {
  display: inline-block;
  max-width: 100%;
  padding-left: 8px;
  border-left: 3px solid var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.history-layer.ok { border-color: #36c98c; }
.history-layer.warning { border-color: #e6ae43; }
.history-layer.critical { border-color: #ed6471; }
.history-layer.running { border-color: #54b4f0; }
.history-edge { color: var(--muted); flex: 0 0 auto; }
.history-open { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-height: 32px; padding: 0; }
.history-layer-detail, .history-layer-detail .details dd, .history-file-path { min-width: 0; overflow-wrap: anywhere; }
.history-layer-detail { border-top: 1px solid var(--line); padding: 16px 0; }
.history-layer-detail .panel-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.history-layer-detail h2 { margin: 0; font-size: 16px; }
.history-layer-detail td small { display: block; margin-top: 4px; }
.history-detail-header h1 { overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .monitoring-history-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .monitoring-history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actuality-nav {
    padding: 8px;
  }

  .actuality-tabs {
    width: 100%;
  }

  .actuality-tabs a {
    flex: 1 1 120px;
    min-width: 0;
  }

  .actuality-page table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-gutter: stable;
  }

  .monitor-settings-head,
  .monitor-settings-actions,
  .monitor-layer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .monitor-settings-actions .button-link,
  .monitor-settings-actions button,
  .monitor-layer-actions button {
    width: 100%;
  }

  .monitor-settings-meta,
  .monitor-layer-row {
    grid-template-columns: 1fr;
  }

  .monitor-layer-actions {
    justify-content: stretch;
  }
}

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

th {
  color: var(--muted);
  font-weight: 600;
}

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

.ui-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.ui-message.notice {
  border-color: rgba(55, 201, 120, 0.35);
  color: #9ee6bd;
}

.ui-message.error {
  border-color: rgba(240, 107, 107, 0.48);
  color: #ffb0b0;
}

.details {
  display: grid;
  grid-template-columns: minmax(100px, 160px) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

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

.details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-row {
  gap: 6px;
  margin-top: 6px;
}

.compact-row .button-link,
.compact-row button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #3d8ed5;
  border-radius: 6px;
  background: #15324b;
  color: var(--text);
  text-decoration: none;
}

.button-link.disabled-link {
  pointer-events: none;
  border-color: var(--line);
  background: #17202a;
  color: var(--muted);
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.link-actions button {
  min-width: 62px;
}

.profiles-create-panel > summary {
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.profiles-create-panel[open] > summary {
  margin-bottom: 12px;
}

.profiles-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-gutter: stable;
}

.profiles-table {
  width: 100%;
  min-width: 820px;
  table-layout: fixed;
}

.profiles-table .profile-name-col {
  width: 21%;
}

.profiles-table .profile-schedule-col {
  width: 16%;
}

.profiles-table .profile-count-col,
.profiles-table .profile-errors-col {
  width: 46px;
}

.profiles-table .profile-run-col {
  width: 15%;
}

.profiles-table .profile-status-col {
  width: 130px;
}

.profiles-table .chip {
  font-size: 12px;
}

.profiles-table .profile-progress-col {
  width: 13%;
}

.profiles-table .profile-settings-col {
  width: 30px;
}

.profiles-table th,
.profiles-table td {
  overflow: hidden;
  padding: 7px 5px;
  vertical-align: middle;
}

.profiles-table th:nth-child(4),
.profiles-table td:nth-child(4),
.profiles-table th:nth-child(8),
.profiles-table td:nth-child(8) {
  padding-right: 3px;
  padding-left: 3px;
  text-align: center;
}

.profile-name-cell a {
  color: #8dccff;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.profile-name-cell {
  position: relative;
  white-space: nowrap;
}

.profile-name-cell a {
  white-space: normal;
}

.profile-name-cell a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.profile-row-actions {
  display: grid;
  grid-template-columns: 74px 82px 94px;
  gap: 5px;
  justify-content: end;
}

.profile-row-actions form {
  margin: 0;
}

.profile-row-actions .compact {
  width: 100%;
  min-height: 28px;
  padding: 3px 6px;
  font-size: 12px;
  white-space: nowrap;
}

.profile-settings-cell {
  text-align: center;
}

.profile-settings-button {
  display: inline-grid;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(95, 179, 255, 0.38);
  border-radius: 6px;
  background: rgba(20, 70, 110, 0.42);
  color: #d7ecff;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.profile-settings-button:hover {
  border-color: rgba(95, 179, 255, 0.78);
  background: rgba(22, 93, 145, 0.78);
  color: #ffffff;
}

.profile-settings-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141b23;
  color: var(--text);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

.profile-settings-dialog::backdrop {
  background: rgba(4, 8, 12, 0.72);
}

.profile-settings-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.profile-settings-dialog-head h2 {
  margin-bottom: 2px;
}

.profile-settings-dialog-head small {
  color: var(--muted);
}

.dialog-close-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-color: var(--line);
  background: transparent;
  font-size: 16px;
}

.profile-settings-dialog .compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  max-width: none;
  padding-bottom: 4px;
}

.agent-connect-dialog {
  width: min(1040px, calc(100vw - 32px));
}

.agent-diagnostic-facts {
  margin: 12px 0;
}

.agent-diagnostic-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.6fr);
  gap: 8px 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.agent-diagnostic-facts dt,
.agent-diagnostic-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.agent-diagnostic-facts dd {
  color: var(--muted);
}

.agent-diagnostic-checks {
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.agent-diagnostic-checks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
}

.agent-diagnostic-checks li > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.agent-diagnostic-checks small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

@media (max-width: 540px) {
  .agent-diagnostic-facts > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

.agent-connect-server {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.agent-connect-server code,
.command-block {
  font-family: Consolas, "Courier New", monospace;
}

.agent-connect-server code {
  min-width: 0;
  padding: 7px 9px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0d141b;
}

.agent-install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 14px 0;
}

.agent-install-grid section {
  min-width: 0;
}

.agent-install-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.agent-install-grid ol {
  margin: 0 0 10px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.command-block {
  box-sizing: border-box;
  width: 100%;
  max-height: 260px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  white-space: pre;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0d141b;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .agent-install-grid {
    grid-template-columns: 1fr;
  }

  .agent-connect-server {
    grid-template-columns: 1fr;
  }
}

.profiles-table .progress-line {
  min-width: 0;
  gap: 6px;
}

.profiles-table .progress-track {
  min-width: 30px;
}

.profiles-table .progress-line strong {
  flex: 0 0 auto;
}

.profiles-table tr[data-profile-row] {
  cursor: grab;
}

.profiles-table tr.dragging td {
  opacity: 0.55;
}

.profiles-table tr.drag-over td {
  box-shadow: inset 0 2px 0 rgba(95, 179, 255, 0.7);
}

.profile-settings-duplicate {
  margin-top: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.profile-settings-duplicate button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-form input {
  width: 180px;
}

button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #3d8ed5;
  border-radius: 6px;
  background: #15324b;
  color: var(--text);
}

button.primary,
.button-link.primary {
  border-color: rgba(55, 201, 120, 0.58);
  background: #123c2b;
}

button.danger,
.button-link.danger {
  border-color: rgba(240, 107, 107, 0.62);
  background: #4a1d23;
}

button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #17202a;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
  border-bottom: 1px solid var(--line);
}

.tabs a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  text-decoration: none;
}

.tabs a.active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.sub-tabs {
  margin-top: -4px;
  padding-left: 18px;
}

.profile-summary {
  display: grid;
  gap: 12px;
  padding: 10px;
}

.profile-page-header {
  align-items: center;
  margin-bottom: 10px;
}

.profile-page-header h1 {
  overflow-wrap: anywhere;
}

.profile-page-header p {
  margin-top: 3px;
  font-size: 13px;
}

.metric-row {
  display: grid;
  grid-template-columns: 72px 72px 88px minmax(280px, 1fr) minmax(320px, 1.12fr);
  gap: 7px;
  align-items: stretch;
}

.metric-row > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.metric-row small {
  display: block;
  color: var(--muted);
}

.metric-row strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.profile-metric {
  display: grid;
  align-content: center;
  text-align: center;
}

.action-groups {
  display: grid;
  grid-template-columns: minmax(380px, 1.35fr) minmax(94px, 0.35fr) minmax(220px, 0.75fr) minmax(350px, 1.2fr);
  gap: 7px;
  margin-bottom: 14px;
}

.profile-links-panel {
  overflow: visible;
}

.profile-action-groups {
  position: sticky;
  top: 8px;
  z-index: 10;
  grid-template-columns: minmax(330px, 1.25fr) minmax(80px, 0.3fr) minmax(190px, 0.72fr) minmax(300px, 1.05fr);
  align-items: center;
  margin: -2px -2px 12px;
  padding: 7px;
  border: 1px solid rgba(55, 74, 93, 0.72);
  border-radius: 8px;
  background: rgba(20, 27, 35, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: start;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.action-group strong {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
}

.profile-action-groups .action-group {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: center;
  gap: 5px;
  align-content: center;
  padding: 5px;
}

.profile-action-groups .action-group strong {
  grid-column: 1 / -1;
  min-height: 14px;
  line-height: 1.15;
}

.profile-action-groups .action-group:nth-child(1) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-action-groups .action-group:nth-child(2) {
  grid-template-columns: minmax(0, 1fr);
}

.profile-action-groups .action-group:nth-child(4) strong {
  padding-right: 88px;
}

.profile-action-groups button,
.profile-action-groups .button-link {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
}

.selection-counter {
  position: absolute;
  top: 4px;
  right: 5px;
  min-height: 18px;
  padding: 2px 7px;
  border: 1px solid rgba(55, 74, 93, 0.72);
  border-radius: 999px;
  background: rgba(37, 50, 64, 0.68);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

.copy-progress-item {
  display: grid;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.copy-progress-head {
  display: grid;
  gap: 2px;
}

.copy-progress-head strong {
  font-size: 14px;
}

.copy-progress-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-progress-item .progress-line > strong {
  margin: 0;
  font-size: 13px;
}

.profile-links-table {
  min-width: 880px;
  table-layout: fixed;
}

.profile-links-table-wrap {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.profile-links-table .select-col {
  width: 22px;
}

.profile-links-table .order-col {
  width: 30px;
}

.profile-links-table .name-col {
  width: 26%;
}

.profile-links-table .endpoint-col {
  width: 23%;
}

.profile-links-table .initiator-col {
  width: 8%;
}

.profile-links-table .status-col {
  width: 68px;
}

.profile-links-table .actions-col {
  width: 78px;
}

.profile-links-table th,
.profile-links-table td {
  padding: 4px 5px;
  font-size: 13px;
  line-height: 1.25;
  vertical-align: middle;
}

.profile-links-table th {
  font-size: 12px;
}

.profile-links-table tr {
  scroll-margin-top: 150px;
}

.profile-links-table tr[data-link-row] {
  cursor: pointer;
}

.profile-links-table tr.dragging td {
  opacity: 0.55;
}

.profile-links-table tr.drag-over td {
  box-shadow: inset 0 2px 0 rgba(95, 179, 255, 0.7);
}

.profile-links-table th:nth-child(1),
.profile-links-table th:nth-child(5),
.profile-links-table th:nth-child(6),
.profile-links-table th:nth-child(7) {
  text-align: center;
}

.profile-links-table small,
.profile-links-table a {
  overflow-wrap: anywhere;
}

.profile-links-table small {
  font-size: 11.5px;
}

.profile-links-table input[type="checkbox"] {
  width: 13px;
  height: 13px;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.order-cell,
.status-cell,
.actions-cell {
  text-align: center;
}

.order-cell {
  color: var(--text);
  font-weight: 700;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  margin-right: 3px;
  color: var(--muted);
  cursor: grab;
  font-weight: 700;
  letter-spacing: 0;
  user-select: none;
}

.dragging .drag-handle {
  cursor: grabbing;
}

.initiator-cell {
  overflow: hidden;
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-cell .chip {
  justify-content: center;
  max-width: 60px;
  min-width: 42px;
  min-height: 20px;
  padding: 1px 5px;
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-stack {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.actions-cell .button-link.compact {
  justify-content: center;
  width: 66px;
  min-height: 26px;
  padding: 3px 5px;
  font-size: 11.5px;
  white-space: nowrap;
}

.link-name-cell {
  font-size: 13.5px;
  font-weight: 600;
}

.link-name-cell a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: #8dccff;
  text-decoration: none;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.link-name-cell a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.endpoint-cell > span,
.endpoint-cell > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-cell > span {
  font-size: 12.5px;
}

.endpoint-cell > small {
  margin-top: 2px;
}

.mini-chip {
  display: inline-flex;
  min-height: 18px;
  margin-top: 4px;
  padding: 1px 6px;
  font-size: 11px;
}

.profile-links-table tr.selected-row td {
  background: rgba(77, 163, 255, 0.08);
}

.profile-links-table tr.batch-selected-row td {
  background: rgba(104, 132, 166, 0.62);
  color: #ffffff;
}

.profile-links-table tr.inactive-row {
  color: var(--muted);
}

.selected-link-row td {
  padding: 0 4px 9px;
  background: rgba(77, 163, 255, 0.05);
}

.inline-link-detail {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(330px, 0.55fr);
  gap: 10px;
  align-items: start;
  margin-left: 34px;
  padding: 9px;
  border: 1px solid rgba(77, 163, 255, 0.25);
  border-radius: 6px;
  background: #141c25;
}

.link-operator-detail {
  align-content: start;
}

.link-engineering-detail {
  grid-column: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(55, 74, 93, 0.7);
  border-radius: 6px;
  background: rgba(8, 12, 18, 0.18);
}

.link-engineering-detail summary {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(95, 179, 255, 0.45);
  border-radius: 6px;
  background: rgba(95, 179, 255, 0.08);
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.link-engineering-detail .details {
  margin-top: 8px;
}

.compact-details {
  grid-template-columns: 92px 1fr;
  gap: 4px 8px;
  font-size: 13px;
}

.endpoint-detail-value {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.endpoint-detail-value strong,
.endpoint-detail-value small {
  overflow-wrap: anywhere;
}

.endpoint-detail-value small {
  color: var(--muted);
}

.link-inline-actions {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 7px;
  align-self: start;
  justify-content: stretch;
  max-width: none;
}

.link-inline-actions form {
  width: 100%;
  margin: 0;
}

.link-inline-actions button,
.link-inline-actions > .button-link {
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 4px 8px;
  font-size: 13px;
}

.button-link.compact {
  padding: 5px 8px;
  justify-content: center;
}

.warning-chips span {
  border-color: rgba(255, 209, 102, 0.35);
  color: #ffd166;
  background: rgba(255, 209, 102, 0.1);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-tile {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.settings-tile span {
  color: var(--muted);
}

.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.schedule-card.disabled {
  opacity: 0.72;
}

.profile-jobs-table-wrap {
  overflow-x: auto;
}

.profile-jobs-table {
  min-width: 960px;
  table-layout: fixed;
}

.profile-jobs-table .job-time-col {
  width: 128px;
}

.profile-jobs-table .job-link-col {
  width: 15%;
}

.profile-jobs-table .job-kind-col {
  width: 112px;
}

.profile-jobs-table .job-status-col {
  width: 130px;
}

.profile-jobs-table .job-result-col {
  width: 26%;
}

.profile-jobs-table .job-event-col {
  width: 21%;
}

.profile-jobs-table .job-action-col {
  width: 84px;
}

.profile-jobs-table th,
.profile-jobs-table td {
  padding: 7px;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.profile-jobs-table th:nth-child(4),
.profile-jobs-table td:nth-child(4),
.profile-jobs-table td:last-child {
  text-align: center;
}

.profile-jobs-table td:last-child .button-link {
  min-width: 70px;
  white-space: nowrap;
}

.job-result-cell strong,
.job-result-cell small {
  display: block;
}

.job-result-cell small {
  margin-top: 3px;
}

.agent-page-header {
  flex-wrap: wrap;
}

.agent-page-header > div:first-child {
  flex: 1 1 320px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.agent-page-header > .button-row {
  flex: 0 1 auto;
}

.agent-summary-metrics .metric strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.agent-card.offline,
.agent-card.disabled {
  border-color: rgba(240, 107, 107, 0.45);
}

.agent-card.busy {
  border-color: rgba(243, 179, 65, 0.45);
}

.agent-card-head,
.agent-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.agent-card-head small {
  display: block;
}

.agent-card-head > div {
  flex: 1 1 200px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.agent-card-meta > small {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

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

.token-panel {
  border-color: rgba(95, 179, 255, 0.65);
}

.permission-table td,
.permission-table th {
  vertical-align: top;
}

.user-create-panel > summary,
.user-edit-foldout > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.user-create-panel[open] > summary,
.user-edit-foldout[open] > summary {
  margin-bottom: 12px;
}

.user-create-panel .section-note {
  margin: 8px 0 12px;
}

.directory-users-panel .section-heading {
  margin-bottom: 10px;
}

.directory-users-summary {
  display: grid;
  grid-template-columns: 120px 160px minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.directory-users-summary > div {
  display: grid;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.directory-users-summary small {
  color: var(--muted);
}

.directory-users-summary strong {
  margin-top: 2px;
}

.directory-users-summary .button-link {
  align-self: center;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.user-card-head,
.user-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-card-head small {
  display: block;
}

.user-edit-foldout {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.user-edit-form {
  grid-template-columns: minmax(180px, 1fr) 180px 140px auto;
  align-items: end;
}

.user-actions {
  justify-content: flex-start;
  margin-top: 10px;
}

.job-toolbar,
.status-tabs,
.job-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.job-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.job-filter-panel {
  margin-bottom: 14px;
}

.job-filter-form {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  align-items: end;
}

.filter-actions {
  display: flex;
  align-items: end;
}

.status-tabs a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.status-tabs a:hover,
.status-tabs a.selected {
  border-color: #3d8ed5;
  background: #15324b;
}

.actuality-nav {
  padding: 8px 10px;
}

.actuality-tabs {
  gap: 5px;
}

.actuality-tabs a {
  min-width: 96px;
  padding: 6px 9px;
  text-align: center;
}

.jobs-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(460px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.job-list-pane,
.job-detail-pane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.job-list-pane {
  padding: 8px;
}

.job-detail-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.job-list {
  display: grid;
  gap: 8px;
}

.compact-grid {
  margin-bottom: 12px;
}

.link-mode-panel > label {
  align-content: start;
}

.between-agents-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.endpoint-side {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding-right: 20px;
}

.endpoint-side + .endpoint-side {
  padding-right: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.endpoint-side > strong {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(55, 74, 93, 0.72);
  color: var(--text);
  font-size: 14px;
}

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

.job-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.job-card:hover,
.job-card.selected {
  border-color: #3d8ed5;
}

.job-card-head,
.job-meta,
.job-detail-head,
.progress-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.job-card-head,
.job-detail-head,
.progress-line {
  align-items: center;
}

.job-card-head small,
.job-meta small {
  display: block;
}

.progress-track {
  position: relative;
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #101820;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--ok));
}

.progress-line.large {
  gap: 14px;
}

.progress-line.large .progress-track {
  height: 12px;
}

.progress-block {
  display: grid;
  gap: 6px;
}

.detail-section {
  display: grid;
  gap: 8px;
}

.detail-section.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-fact-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.job-fact-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(55, 74, 93, 0.72);
}

.job-fact-row dt {
  color: var(--muted);
}

.job-fact-row dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.job-fact-row dd strong,
.job-fact-row dd small {
  display: block;
}

.job-fact-row dd small {
  margin-top: 2px;
  color: var(--muted);
}

.technical-details {
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.technical-details > summary {
  padding: 8px 0;
  color: var(--muted);
  cursor: pointer;
}

.technical-payloads {
  margin-top: 6px;
}

.event-stack.detailed .event-line {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.payload-block {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f151b;
  color: var(--text);
  font: 12px/1.45 Consolas, "Cascadia Mono", monospace;
  white-space: pre-wrap;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111820;
  color: var(--text);
}

textarea {
  resize: vertical;
}

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

legend {
  padding: 0 6px;
  color: var(--muted);
}

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

.compact-form {
  grid-template-columns: minmax(260px, 1fr) 160px auto;
  align-items: end;
}

.form-grid.smtp-settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.profile-create-form {
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 320px);
  align-items: start;
  max-width: 920px;
  margin-top: 10px;
}

.profile-create-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 16px;
}

.profile-create-actions .checkline {
  width: auto;
  margin: 0;
}

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

.tabbed-link-form {
  align-items: start;
}

.link-form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
}

.link-form-tabs button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.link-form-tabs .workflow-tab::before {
  content: attr(data-tab-step);
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(155, 184, 214, 0.34);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.link-form-tabs .workflow-tab.active::before,
.link-form-tabs .workflow-tab:hover::before {
  border-color: rgba(95, 179, 255, 0.78);
  color: var(--text);
  background: rgba(95, 179, 255, 0.16);
}

.link-form-tabs .engineering-tab {
  margin-left: auto;
  border-color: rgba(155, 184, 214, 0.24);
  background: rgba(255, 255, 255, 0.018);
}

.link-form-tabs button.active,
.link-form-tabs button:hover {
  border-color: #2e76a8;
  background: #12314a;
  color: var(--text);
}

[hidden] {
  display: none !important;
}

.link-mode-panel[hidden],
[data-link-direction-panel][hidden],
[data-advanced-legacy-field][hidden] {
  display: none !important;
}

.link-tab-panel {
  grid-column: 1 / -1;
}

.link-history-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.link-history-panel h3 {
  margin: 0 0 12px;
}

.link-form-section {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
}

.link-settings {
  display: contents;
}

.link-settings fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  background: rgba(255, 255, 255, 0.015);
}

.settings-subsection {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 10px;
  border: 1px solid rgba(55, 74, 93, 0.72);
  border-radius: 6px;
  background: rgba(8, 12, 18, 0.22);
}

.settings-subsection strong {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 13px;
}

.compact-field {
  width: 100%;
  max-width: 420px;
}

.link-settings select {
  width: 100%;
  max-width: 560px;
}

.link-settings input[type="number"],
.link-settings input[type="time"] {
  width: 100%;
  max-width: 240px;
}

[data-link-mode-select] {
  width: 100%;
  max-width: 560px;
}

[data-link-direction-select] {
  width: 100%;
  max-width: 620px;
}

.dependent-setting {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.dependent-setting .checkline {
  min-height: 34px;
}

.dependent-setting-value {
  width: min(100%, 320px);
  margin-left: 26px;
  padding-left: 12px;
  border-left: 2px solid rgba(95, 179, 255, 0.28);
}

.dependent-setting-value input[type="number"] {
  max-width: 220px;
}

.dependent-setting-option {
  margin-left: 26px;
}

.dependent-setting-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 240px));
  gap: 10px 12px;
  margin-left: 26px;
  padding-left: 12px;
  border-left: 2px solid rgba(95, 179, 255, 0.28);
}

.disabled-field {
  opacity: 0.68;
}

.route-hint {
  display: block;
  margin-top: -4px;
  color: var(--muted);
}

.format-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.route-hint.warning {
  color: #f3c76b;
}

.link-preview {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(95, 179, 255, 0.24);
  border-radius: 6px;
  background: rgba(18, 27, 36, 0.72);
}

.link-preview.loading {
  opacity: 0.72;
}

.link-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.link-preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.link-preview-head h3 {
  margin: 0;
  font-size: 15px;
}

.link-preview-details {
  margin: 0;
}

.preview-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-notes.error span {
  border-color: rgba(255, 119, 119, 0.35);
  color: #ffaaaa;
}

.inline-note-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.inline-note-list span {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.agent-select-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.agent-select-note.ok {
  color: #8ee7b4;
}

.agent-select-note.warning {
  color: #ffd28a;
}

.preflight-result {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 12, 18, 0.35);
}

.preflight-result[hidden] {
  display: none !important;
}

.preflight-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preflight-checks span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.preflight-checks span.ok {
  border-color: rgba(72, 211, 141, 0.35);
  color: #7fe7ad;
}

.preflight-checks span.warning,
.preflight-checks span.not_implemented {
  border-color: rgba(243, 199, 107, 0.36);
  color: #f3c76b;
}

.preflight-checks span.error {
  border-color: rgba(255, 119, 119, 0.36);
  color: #ffaaaa;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  gap: 8px;
}

.weekday-picker label {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111820;
  color: var(--text);
}

.weekday-picker input {
  width: auto;
  min-height: auto;
  margin-right: 5px;
}

.monthly-schedule-panel {
  display: grid;
  gap: 8px;
}

.monthly-schedule-panel[hidden] {
  display: none;
}

.monthly-schedule-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(280px, 1fr);
  gap: 10px;
}

.monthly-schedule-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-chips span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111820;
  color: var(--text);
  font-size: 12px;
}

.note-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.note-stack span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(95, 179, 255, 0.28);
  border-radius: 999px;
  background: rgba(95, 179, 255, 0.08);
  color: var(--text);
  font-size: 12px;
}

.form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.field-help {
  display: block;
  color: #9bb4ca;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.checkline + .field-help,
.checkline .field-help {
  margin-left: 24px;
}

.checkline {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text) !important;
}

.checkline[hidden] {
  display: none !important;
}

.checkline input {
  width: auto;
  min-height: auto;
}

.danger-check {
  color: #ffd0d0 !important;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

@media (max-width: 1280px) {
  .profile-summary .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-summary .copy-progress-item {
    grid-column: 1 / -1;
  }

  .profile-action-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-action-groups .action-group:nth-child(1) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .directory-users-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monthly-schedule-fields {
    grid-template-columns: 1fr;
  }

  .monitoring-widget-grid {
    grid-template-columns: 1fr;
  }

  .monitoring-widget {
    grid-column: 1 / -1;
  }

  .sidebar {
    position: static;
    width: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .page {
    margin-left: 0;
  }

  .brand {
    margin: 2px 6px 10px;
    font-size: 20px;
  }

  nav {
    display: flex;
    max-width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-gutter: stable;
  }

  nav a {
    flex: 0 0 auto;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .link-form-tabs .engineering-tab {
    margin-left: 0;
  }

  .freshness-head,
  .freshness-meta,
  .panel-toolbar,
  .layer-strip,
  .connection-head,
  .route-line {
    align-items: stretch;
    flex-direction: column;
  }

  .freshness-meta {
    justify-content: flex-start;
  }

  .layer-node {
    min-width: 0;
  }

  .layer-arrow {
    display: none;
  }

  .endpoint-box,
  .route-arrow {
    min-width: 0;
    width: 100%;
  }

  .grid.three,
  .job-metrics,
  .workbench,
  .jobs-layout,
  .detail-section.split,
  .form-grid,
    .form-grid.smtp-settings-form,
    .compact-form,
    .link-form,
    .user-edit-form,
    .action-groups,
    .settings-grid,
    .settings-subsection,
    .link-settings,
    .agent-grid,
    .agent-mini-metrics,
    .chain-rule-summary,
    .freshness-card-grid,
    .compact-list,
    .inline-link-detail,
    .monitoring-widget-layout-form,
    .monitoring-widget-editor-dock .monitoring-widget-layout-form,
    fieldset {
    grid-template-columns: 1fr;
  }

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

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

  .metric-row .copy-progress-item {
    grid-column: 1 / -1;
  }

  .profile-action-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-action-groups .action-group:nth-child(1) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weekday-picker {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }

  .between-agents-layout {
    grid-template-columns: 1fr;
  }

  .endpoint-side {
    padding-right: 0;
  }

  .endpoint-side + .endpoint-side {
    margin-top: 14px;
    padding-top: 14px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .dependent-setting-fields {
    grid-template-columns: 1fr;
  }

  .notification-event-line {
    grid-template-columns: 1fr;
  }

  .notification-event-action {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

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

  .detail-section.split > * {
    min-width: 0;
  }

  .profiles-table {
    min-width: 820px;
  }

}

@media (max-width: 640px) {
  .link-preview-head {
    flex-wrap: wrap;
  }

  .link-preview-head h3 {
    flex-basis: 100%;
  }

  .link-preview-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .directory-users-summary {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 12px;
  }

  .profile-page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .profile-tabs {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .profile-tabs a {
    flex: 0 0 auto;
  }

  .profile-action-groups {
    position: static;
    grid-template-columns: 1fr;
  }

  .profile-action-groups .action-group,
  .profile-action-groups .action-group:nth-child(1) {
    grid-template-columns: 1fr;
  }

  .profile-settings-dialog .compact-form {
    grid-template-columns: 1fr;
  }

  .profile-create-form {
    grid-template-columns: 1fr;
  }

  .profile-create-actions {
    grid-column: 1;
  }

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

  .weekday-picker {
    grid-template-columns: repeat(2, minmax(44px, 1fr));
  }

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

  .job-card-head,
  .job-detail-head,
  .job-meta {
    min-width: 0;
    flex-wrap: wrap;
  }

  .job-card-head > div,
  .job-card-head small,
  .job-meta small {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .job-detail-pane .details {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .job-detail-pane .event-line > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
