.mt-inventory-controls {
  display: grid;
  grid-template-columns: minmax(18rem, 1.7fr) repeat(3, minmax(9rem, .8fr)) auto auto auto minmax(7rem, auto);
  gap: .65rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: .85rem;
  border: 1px solid #d6e0ed;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 3px 14px rgba(15, 23, 42, .05);
}

.mt-inventory-controls > label {
  display: grid;
  min-width: 0;
  gap: .35rem;
}

.mt-inventory-controls > label > span,
.mt-inventory-view legend {
  color: #64748b;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.mt-columns-control[hidden] { display: none !important; }

.mt-inventory-controls select,
.mt-inventory-controls input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  border: 1px solid #c6d2e2;
  border-radius: .72rem;
  background: #fff;
  color: #17243a;
  padding: .58rem .7rem;
}

.mt-inventory-controls input:focus,
.mt-inventory-controls select:focus {
  border-color: #2473da;
  outline: 3px solid rgba(36, 115, 218, .14);
}

.mt-inventory-search > div {
  position: relative;
}

.mt-inventory-search > div > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: .75rem;
  width: 1rem;
  height: 1rem;
  margin: 0;
  color: #64748b;
  transform: translateY(-50%);
  pointer-events: none;
}

.mt-inventory-search input { padding-left: 2.25rem; }

.mt-inventory-view {
  display: grid;
  grid-template-columns: repeat(2, 2.65rem);
  gap: .35rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mt-inventory-view legend {
  grid-column: 1 / -1;
  padding: 0;
}

.mt-inventory-result {
  display: grid;
  align-content: center;
  min-height: 2.65rem;
  color: #64748b;
  font-size: .78rem;
  white-space: nowrap;
}

.mt-inventory-result b { color: #0f172a; font-size: 1rem; }
.mt-inventory-result button { padding: 0; border: 0; color: #1769ed; background: transparent; font-size: .72rem; text-align: left; }

.mt-device-section-head { align-items: flex-end; }
.mt-device-add-button,
.mt-device-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .42rem;
}

.mt-device-add-button > svg,
.mt-device-action > svg {
  position: static !important;
  display: block !important;
  flex: 0 0 1rem;
  width: 1rem !important;
  height: 1rem !important;
  margin: 0 !important;
  transform: none !important;
}

.mt-device-grid.mt-device-grid-columns {
  display: grid;
  grid-template-columns: repeat(var(--mt-device-columns, 4), minmax(0, 1fr));
  gap: .9rem;
}

.mt-device-grid-columns[data-columns="1"] { grid-template-columns: minmax(0, 1fr); }
.mt-device-grid-columns[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt-device-grid-columns[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt-device-grid-columns[data-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.mt-device-card {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.mt-device-card > .mt-device-card-head {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: start;
  gap: .7rem;
}

.mt-device-card-head > div { min-width: 0; }
.mt-device-card-head h3,
.mt-device-card-head p { overflow-wrap: anywhere; }

.mt-device-kind {
  display: block;
  margin-bottom: .18rem;
  color: #2563eb;
  font-size: .64rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.mt-device-card-icon,
.mt-device-table-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: .8rem;
  background: #0f62b5;
  color: #fff;
  box-shadow: 0 0 0 3px #dbeafe;
}

.mt-device-card-icon > svg,
.mt-device-table-icon > svg {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 2rem !important;
  height: 2rem !important;
  margin: 0 !important;
  fill: none !important;
  color: #fff !important;
  stroke: currentColor !important;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: none !important;
}

.mt-device-address {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mt-device-card .mt-device-metrics dd { overflow-wrap: anywhere; }
.mt-device-card .mt-device-tags span { max-width: 100%; overflow-wrap: anywhere; }
.mt-device-card > .mt-device-actions { display: flex; align-items: center; justify-content: flex-start; gap: .4rem; }
.mt-device-action { padding: .52rem .65rem !important; font-size: .77rem; }

.mt-device-table { margin-bottom: .8rem; }
.mt-device-table table { min-width: 72rem; }
.mt-device-table tbody tr:hover { background: #f8fbff; }
.mt-device-table tr.is-inactive { opacity: .72; }
.mt-device-table td { font-size: .82rem; }
.mt-device-table code { overflow-wrap: anywhere; }
.mt-device-table-identity { display: flex; min-width: 13rem; align-items: center; gap: .7rem; }
.mt-device-table-identity > div { min-width: 0; }
.mt-device-table-identity b { overflow-wrap: anywhere; }
.mt-device-table-icon { width: 2.55rem; height: 2.55rem; border-radius: .7rem; }
.mt-device-table-icon > svg { width: 1.65rem !important; height: 1.65rem !important; }
.mt-table-interface.up { color: #047857; }
.mt-table-interface.down { color: #be123c; }
.mt-device-row-actions { display: flex; min-width: max-content; flex-wrap: wrap; gap: .3rem; }

.mt-device-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  padding: .7rem .85rem;
  border: 1px solid #d6e0ed;
  border-radius: .85rem;
  background: #fff;
  color: #64748b;
}

.mt-device-pagination > div,
.mt-device-pagination label { display: flex; align-items: center; gap: .4rem; }
.mt-device-pagination select { min-height: 2.25rem; border: 1px solid #c6d2e2; border-radius: .6rem; padding: .35rem .55rem; background: #fff; }
.mt-device-pagination i { font-style: normal; }

.mt-company-filter {
  padding: .85rem 1rem;
  border: 1px solid #d6e0ed;
  border-radius: .9rem;
  background: #fff;
}

.mt-company-filter label {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 800;
}

.mt-company-filter select {
  min-width: min(24rem, 65vw);
  margin-left: 0;
  border: 1px solid #c6d2e2;
  border-radius: .7rem;
  padding: .65rem .8rem;
  background: #fff;
  color: #17243a;
}

.mt-company-filter > span {
  color: #667792;
  font-weight: 700;
}

.mt-device-card.is-inactive {
  border-style: dashed;
  background: #f8fafc;
}

.mt-device-card.is-inactive .mt-device-metrics,
.mt-device-card.is-inactive .mt-interfaces {
  opacity: .72;
}

.mt-lifecycle-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border: 1px solid #86efac;
  border-radius: .8rem;
  background: #f0fdf4;
  color: #047857;
}

.mt-lifecycle-state.is-inactive {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.mt-lifecycle-state span {
  color: #667792;
  text-align: right;
}

.mt-vpn-state,
.mt-backup-state,
.mt-managed-profile {
  display: grid;
  gap: .25rem;
  margin-top: .65rem;
  padding: .75rem .85rem;
  border: 1px solid #cbd5e1;
  border-radius: .8rem;
  background: #f8fafc;
  color: #334155;
}

.mt-vpn-state.connected {
  border-color: #86efac;
  background: #f0fdf4;
  color: #047857;
}

.mt-vpn-state.waiting {
  border-color: #fde68a;
  background: #fffbeb;
}

.mt-vpn-state span,
.mt-backup-state span,
.mt-managed-profile span {
  font-size: .82rem;
}

.mt-download {
  display: block;
  max-width: 24rem;
  overflow-wrap: anywhere;
  color: #0f62b5;
  font-weight: 750;
  text-decoration: none;
}

.mt-download:hover {
  text-decoration: underline;
}

.mt-page-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}

.mt-page-refresh > svg {
  display: block;
  width: 1rem;
  height: 1rem;
  margin: 0;
  fill: currentColor;
}

.mt-backup-options {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: .85rem;
  background: #eff6ff;
}

.mt-map-control-deck {
  margin: .85rem 0 1rem;
  padding: .65rem;
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: linear-gradient(135deg, #fff, #f8fbff);
  box-shadow: 0 8px 28px rgba(30, 64, 175, .07);
}

.mt-map-toolbar {
  display: grid;
  grid-template-columns: minmax(13rem, .8fr) minmax(24rem, 1.3fr) auto;
  gap: .65rem;
  align-items: center;
  padding: 0;
  background: transparent;
}

.mt-map-selector {
  display: grid;
  grid-template-columns: auto minmax(8rem, 1fr);
  align-items: center;
  min-width: 0;
  gap: .55rem;
}

.mt-map-selector > span,
.mt-map-zoom > span {
  color: #64748b;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mt-map-selector select {
  width: 100%;
  min-height: 2.65rem;
}

.mt-map-zoom {
  display: grid;
  grid-template-columns: auto 2.25rem minmax(8rem, 1fr) 2.25rem 4.2rem 2.25rem;
  gap: .45rem;
  align-items: center;
  height: 2.65rem;
  padding: .2rem .45rem;
  border: 1px solid #dbe3ef;
  border-radius: .8rem;
  background: #f8fafc;
}

.mt-map-zoom > span { margin-right: .15rem; }
.mt-map-zoom output {
  min-width: 0;
  padding: .28rem .45rem;
  border-radius: .55rem;
  background: #e8f1ff;
  color: #164e9d;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: center;
}

.mt-map-icon-actions {
  display: flex;
  gap: .45rem;
  margin-left: auto;
  align-items: center;
  justify-content: flex-end;
}

.xforce-mikrotik-page button.mt-icon-button {
  display: inline-flex !important;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
  min-width: 2.65rem;
  min-height: 2.65rem;
  padding: 0;
  align-items: center !important;
  justify-content: center !important;
  border-radius: .75rem;
  line-height: 1 !important;
  vertical-align: middle;
}

.xforce-mikrotik-page button.mt-icon-button.compact {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: .65rem;
}

.xforce-mikrotik-page button.mt-icon-button > svg.bi {
  position: static !important;
  inset: auto !important;
  display: block !important;
  flex: 0 0 1.2rem;
  width: 1.2rem !important;
  height: 1.2rem !important;
  min-width: 1.2rem !important;
  min-height: 1.2rem !important;
  max-width: 1.2rem !important;
  max-height: 1.2rem !important;
  margin: 0 !important;
  padding: 0 !important;
  fill: currentColor;
  stroke: none;
  transform: none !important;
}

.mt-map-toolbar input[type="range"] {
  width: 100%;
}

.mt-map-viewport {
  position: relative;
  width: 100%;
  min-height: 34rem;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  background: #e2e8f0;
  box-shadow: inset 0 2px 12px rgba(15, 23, 42, .08);
  background-position: center;
  background-repeat: no-repeat;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.mt-map-surface {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  overflow: visible;
}

.mt-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.mt-map-layout.has-detail {
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem);
}

.mt-map-stage {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  transform-origin: left top;
  touch-action: pan-x pan-y;
  background: transparent;
  will-change: transform;
}

.mt-map-viewport.bg-aurora {
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, .32), transparent 34%),
    radial-gradient(circle at 78% 28%, rgba(139, 92, 246, .3), transparent 36%),
    radial-gradient(circle at 52% 82%, rgba(16, 185, 129, .24), transparent 42%),
    linear-gradient(145deg, #081426, #102c46 54%, #13213a);
}

.mt-map-viewport.bg-blueprint {
  background-color: #082f49;
  background-image: linear-gradient(rgba(125, 211, 252, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(125, 211, 252, .13) 1px, transparent 1px);
  background-size: 32px 32px;
}

.mt-map-viewport.bg-grid {
  background-color: #f8fafc;
  background-image: linear-gradient(#dbeafe 1px, transparent 1px), linear-gradient(90deg, #dbeafe 1px, transparent 1px);
  background-size: 28px 28px;
}

.mt-map-viewport.bg-midnight {
  background:
    radial-gradient(circle at 30% 30%, rgba(14, 165, 233, .17), transparent 30%),
    radial-gradient(circle at 70% 70%, rgba(99, 102, 241, .18), transparent 30%),
    #020617;
}

.mt-map-viewport.has-custom-background {
  background-color: #0f172a;
  background-image: var(--mt-map-background-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.mt-map-stage > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mt-map-link { pointer-events: visiblePainted; cursor: default; }
.mt-map-link[data-action] { cursor: pointer; }
.mt-map-link[data-action]:focus { outline: none; }
.mt-map-link[data-action]:hover line:not(.mt-map-link-hit),
.mt-map-link:focus line:not(.mt-map-link-hit) { stroke-width: 7; }
.mt-map-link .mt-map-link-hit { stroke: transparent; stroke-width: 22; pointer-events: stroke; }

.mt-map-link line {
  stroke: #e2e8f0;
  stroke-width: 4;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
}

.mt-map-link.dashed line { stroke-dasharray: 12 8; }
.mt-map-link.vpn line { stroke: #2dd4bf; stroke-dasharray: 5 5; }
.mt-map-link.traffic-live line { stroke: #22c55e; }
.mt-map-link.traffic-warming line,
.mt-map-link.traffic-waiting line { stroke: #38bdf8; }
.mt-map-link.traffic-down line,
.mt-map-link.traffic-disabled line { stroke: #ef4444; }
.mt-map-link.traffic-stale line { stroke: #94a3b8; }
.mt-map-link.traffic-unknown line { stroke: #94a3b8; stroke-dasharray: 4 7; }

.mt-map-link text {
  fill: #fff;
  font: 750 18px system-ui, sans-serif;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #0f172a;
  stroke-width: 5.5px;
  pointer-events: none;
}

.mt-map-link-copy { transform-box: fill-box; transform-origin: center; }
.mt-map-link .mt-map-link-label { font-size: 22px; font-weight: 850; }
.mt-map-link .mt-map-link-interface { fill: #dbeafe; font-size: 18px; }
.mt-map-link .mt-map-link-rate { fill: #fff; font-size: 18px; }
.mt-map-link.traffic-down .mt-map-link-rate,
.mt-map-link.traffic-disabled .mt-map-link-rate { fill: #fecaca; }
.mt-map-link.traffic-stale .mt-map-link-rate { fill: #cbd5e1; }

.mt-map-link-editor small {
  display: block;
  margin-top: .35rem;
  color: #64748b;
  line-height: 1.35;
}

.mt-map-node {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  box-sizing: border-box;
  width: 232px;
  height: 152px;
  min-height: 152px;
  padding: .7rem .85rem .8rem;
  border: 2px solid #94a3b8;
  border-radius: .9rem;
  background: rgba(255, 255, 255, .94);
  color: #17243a;
  text-align: center;
  cursor: grab;
  box-shadow: 0 8px 24px rgba(2, 6, 23, .3);
  user-select: none;
  touch-action: none;
}

.mt-map-node.online { border-color: #22c55e; }
.mt-map-node.offline { border-color: #ef4444; }
.mt-map-node.unknown { border-color: #94a3b8; border-style: dashed; }
.mt-map-node.inactive { border-style: dashed; opacity: .72; }
.mt-map-node.dragging { cursor: grabbing; z-index: 5; box-shadow: 0 14px 32px rgba(2, 6, 23, .45); }
.mt-map-node.selected { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .24), 0 14px 32px rgba(2, 6, 23, .42); }

.mt-map-node-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: .35rem;
  border-radius: .75rem;
  background: #0f62b5;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .24);
  overflow: hidden;
}

.mt-map-node.online .mt-map-node-icon { box-shadow: 0 0 0 4px rgba(34, 197, 94, .25); }
.mt-map-node.offline .mt-map-node-icon { box-shadow: 0 0 0 4px rgba(239, 68, 68, .25); }

.mt-map-node-icon svg,
.mt-map-detail-icon svg {
  position: static !important;
  inset: auto !important;
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem;
  min-height: 2rem;
  display: block;
  fill: none !important;
  color: #fff !important;
  stroke: currentColor !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transform: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.mt-map-timeline {
  display: grid;
  grid-template-columns: minmax(7.5rem, auto) minmax(15rem, 1fr) auto;
  min-width: 0;
  gap: .6rem;
  align-items: center;
  margin: 0;
  min-height: 2.65rem;
  padding: .3rem .45rem;
  border: 1px solid #bfdbfe;
  border-radius: .85rem;
  background: #eff6ff;
}

.mt-timeline-status { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: center; }
.mt-timeline-status strong { font-size: .8rem; }
.mt-timeline-status small { grid-column: 2; font-size: .64rem; white-space: nowrap; }
.mt-live-dot { grid-row: 1 / span 2; width: .65rem; height: .65rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 5px rgba(34, 197, 94, .14); }
.mt-map-timeline.historical .mt-live-dot { background: #f59e0b; box-shadow: 0 0 0 5px rgba(245, 158, 11, .15); }
.mt-timeline-actions { display: flex; gap: .4rem; }
.mt-map-timeline label { display: grid; grid-template-columns: minmax(8rem, 1fr) auto; min-width: 0; gap: .55rem; align-items: center; font-weight: 800; }
.mt-map-timeline label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-map-timeline input { width: 100%; }
.mt-map-timeline output { min-width: 7.2rem; color: #1d4ed8; font-size: .76rem; font-variant-numeric: tabular-nums; text-align: right; }
.mt-map-timeline small { color: #64748b; }
.mt-map-timeline.historical { border-color: #f59e0b; background: #fffbeb; }

.mt-update-overview {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid #fecaca;
  border-left: 5px solid #ef4444;
  border-radius: 1rem;
  background: #fff;
}

.mt-update-overview.active { border-color: #86efac; border-left-color: #22c55e; }
.mt-update-overview > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mt-update-overview > header span { color: #2563eb; font-size: .68rem; font-weight: 850; letter-spacing: .1em; }
.mt-update-overview > header h2 { margin: .2rem 0; }
.mt-update-overview > header p { margin: 0; color: #475569; }
.mt-update-gates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.mt-update-gates article { display: flex; min-width: 0; gap: .55rem; align-items: center; padding: .65rem; border: 1px solid #e2e8f0; border-radius: .75rem; background: #f8fafc; }
.mt-update-gates article > span { display: grid; flex: 0 0 auto; width: 1.6rem; height: 1.6rem; place-items: center; border-radius: 50%; font-weight: 900; }
.mt-update-gates article.ready > span { background: #dcfce7; color: #047857; }
.mt-update-gates article.blocked > span { background: #fee2e2; color: #b91c1c; }
.mt-update-gates article div { display: grid; min-width: 0; }
.mt-update-gates b { font-size: .78rem; }
.mt-update-gates small { overflow: hidden; color: #64748b; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.mt-update-help { margin: 0; padding: .7rem; border-radius: .7rem; background: #fff7ed; color: #9a3412; }
.mt-update-actions { display: flex; align-items: center; gap: .4rem; }
.mt-update-runtime { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.mt-update-runtime span { min-width: 0; padding: .65rem; border: 1px solid #dbeafe; border-radius: .7rem; background: #f8fbff; color: #475569; font-size: .75rem; overflow-wrap: anywhere; }
.mt-update-runtime b { display: block; margin-bottom: .2rem; color: #0f172a; font-size: .68rem; text-transform: uppercase; }
.mt-update-blockers { padding: .75rem; border: 1px solid #fecaca; border-radius: .75rem; background: #fff7f7; }
.mt-update-blockers h3 { margin: 0 0 .5rem; color: #991b1b; font-size: .85rem; }
.mt-update-blockers ul,
.mt-update-device-gates ul { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.mt-update-blockers li,
.mt-update-device-gates li { display: grid; gap: .12rem; }
.mt-update-blockers li b { color: #991b1b; font-size: .74rem; }
.mt-update-blockers li span,
.mt-update-device-gates li span { color: #64748b; font-size: .7rem; overflow-wrap: anywhere; }
.mt-update-operator-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; padding: .75rem; border: 1px solid #bfdbfe; border-radius: .8rem; background: #eff6ff; }
.mt-update-operator-guide h3 { grid-column: 1 / -1; margin: 0; color: #1e3a8a; font-size: .85rem; }
.mt-update-operator-guide article { display: grid; align-content: start; gap: .35rem; min-width: 0; padding: .7rem; border: 1px solid #dbeafe; border-radius: .7rem; background: #fff; }
.mt-update-operator-guide article.blocked { border-color: #fdba74; background: #fff7ed; }
.mt-update-operator-guide article.ready { border-color: #86efac; background: #f0fdf4; }
.mt-update-operator-guide b { font-size: .76rem; }
.mt-update-operator-guide p,
.mt-update-operator-guide small { margin: 0; color: #475569; font-size: .7rem; overflow-wrap: anywhere; }
.mt-update-operator-guide code { display: block; overflow: auto; max-width: 100%; padding: .45rem; border-radius: .45rem; background: #e2e8f0; color: #0f172a; font-size: .67rem; white-space: nowrap; }
.mt-update-device-gates { min-width: 12rem; margin-top: .4rem; }
.mt-update-device-gates summary { color: #1d4ed8; font-size: .72rem; font-weight: 800; cursor: pointer; }
.mt-update-device-gates ul { max-width: 25rem; margin-top: .45rem; padding: .55rem; border: 1px solid #dbe3ef; border-radius: .65rem; background: #fff; }
.mt-update-device-gates li.ready b { color: #047857; }
.mt-update-device-gates li.blocked b { color: #b91c1c; }

@media (max-width: 800px) {
  .mt-update-operator-guide { grid-template-columns: 1fr; }
}

.mt-map-node strong,
.mt-map-node small,
.mt-map-node em {
  max-width: 100%;
}

.mt-map-node strong {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.35em;
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.17;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mt-map-node small {
  overflow: hidden;
  width: 100%;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-map-node em { color: #0f766e; font-size: .76rem; font-style: normal; font-weight: 700; }

.mt-map-stage[data-zoom-band="overview"] .mt-map-link-copy,
.mt-map-stage[data-zoom-band="overview"] .mt-map-node strong,
.mt-map-stage[data-zoom-band="overview"] .mt-map-node small,
.mt-map-stage[data-zoom-band="overview"] .mt-map-node em {
  display: none;
}

.mt-map-stage[data-zoom-band="overview"] .mt-map-node {
  align-content: center;
}

.mt-map-stage[data-zoom-band="overview"] .mt-map-node-icon {
  margin-bottom: 0;
}

.mt-map-stage[data-zoom-band="compact"] .mt-map-link-interface,
.mt-map-stage[data-zoom-band="compact"] .mt-map-link-rate,
.mt-map-stage[data-zoom-band="compact"] .mt-map-node small,
.mt-map-stage[data-zoom-band="compact"] .mt-map-node em {
  display: none;
}

.mt-map-stage[data-zoom-band="compact"] .mt-map-node {
  align-content: center;
}

.mt-map-timeline-deck {
  margin: 1rem 0 .75rem;
}

.mt-map-detail-panel {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: .85rem;
  max-height: 70vh;
  overflow: auto;
  padding: 1rem;
  border: 1px solid #cbd5e1;
  border-top: 4px solid #94a3b8;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 14px 38px rgba(15, 23, 42, .14);
}

.mt-map-detail-panel.online { border-top-color: #22c55e; }
.mt-map-detail-panel.offline { border-top-color: #ef4444; }
.mt-map-detail-panel.unknown { border-top-color: #94a3b8; }

.mt-map-detail-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.mt-map-detail-panel > header button {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.4rem;
}

.mt-map-detail-icon {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border-radius: 1rem;
  background: #0f62b5;
  color: #fff;
}

.mt-map-detail-title {
  display: grid;
  gap: .3rem;
}

.mt-map-detail-title > span {
  color: #2563eb;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mt-map-detail-title h2 { margin: 0; overflow-wrap: anywhere; }
.mt-map-detail-title code { color: #0f172a; font-size: .82rem; overflow-wrap: anywhere; }
.mt-map-detail-title p { margin: 0; color: #64748b; }
.mt-map-detail-title .mt-badge { justify-self: start; }

.mt-map-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: 0;
}

.mt-map-detail-metrics > div {
  min-width: 0;
  padding: .65rem;
  border: 1px solid #e2e8f0;
  border-radius: .7rem;
  background: #f8fafc;
}

.mt-map-detail-metrics dt { color: #64748b; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.mt-map-detail-metrics dd { margin: .2rem 0 0; color: #0f172a; font-size: .82rem; font-weight: 800; overflow-wrap: anywhere; }

.mt-map-detail-vpn {
  display: grid;
  gap: .2rem;
  padding: .7rem;
  border: 1px solid #99f6e4;
  border-radius: .75rem;
  background: #f0fdfa;
  color: #0f766e;
  font-size: .78rem;
}

.mt-map-history-note {
  display: grid;
  gap: .25rem;
  padding: .7rem;
  border: 1px solid #fcd34d;
  border-radius: .75rem;
  background: #fffbeb;
  color: #92400e;
  font-size: .76rem;
}

.mt-map-detail-panel [hidden] { display: none !important; }

.mt-map-detail-interfaces h3 { margin: 0 0 .55rem; font-size: .9rem; }
.mt-map-detail-interfaces { display: grid; gap: .5rem; }

.mt-map-detail-interface {
  display: grid;
  gap: .35rem;
  padding: .65rem;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #ef4444;
  border-radius: .7rem;
  background: #fff;
}

.mt-map-detail-interface.up { border-left-color: #22c55e; }
.mt-map-detail-interface header,
.mt-map-detail-interface > div { display: flex; justify-content: space-between; gap: .6rem; }
.mt-map-detail-interface header span { color: #64748b; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.mt-map-detail-interface > div span { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 800; }
.mt-map-detail-interface .rx { color: #059669; }
.mt-map-detail-interface .tx { color: #dc2626; }
.mt-map-detail-interface i,
.mt-map-detail-vpn i { font-style: normal; }
.mt-map-detail-interface > div b { font-size: 1.05rem; }
.mt-map-detail-interface small,
.mt-map-detail-empty { color: #64748b; font-size: .72rem; }

.mt-map-detail-panel > footer {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  color: #64748b;
  font-size: .7rem;
}

.mt-map-detail-panel > footer span,
.mt-map-detail-panel > footer b { color: #047857; font-weight: 800; }
.mt-map-detail-panel > footer i { display: inline-block; width: .45rem; height: .45rem; margin-right: .25rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .15); }

.mt-map-detail-facts {
  display: grid;
  gap: .35rem;
  padding: .7rem;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  background: #f8fafc;
  color: #475569;
  font-size: .76rem;
}

.mt-map-detail-facts span { display: flex; justify-content: space-between; gap: .5rem; }
.mt-map-detail-facts b { color: #0f172a; }
.mt-map-detail-connections { display: grid; gap: .5rem; }
.mt-map-detail-connections > header { display: flex; align-items: center; justify-content: space-between; }
.mt-map-detail-connections h3 { margin: 0; font-size: .9rem; }
.mt-map-connection { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem; border: 1px solid #dbeafe; border-radius: .7rem; background: #f8fbff; }
.mt-map-connection > div:first-child { display: grid; min-width: 0; gap: .15rem; }
.mt-map-connection small { color: #64748b; overflow-wrap: anywhere; }
.mt-map-connection > div:last-child { display: flex; gap: .3rem; }

#xforce-toast-region {
  position: fixed;
  z-index: 100000;
  top: 1.25rem;
  right: 1.25rem;
  display: grid;
  width: min(26rem, calc(100vw - 2rem));
  gap: .55rem;
  pointer-events: none;
}

[data-xforce-save-toast-promoted="true"] { display: none !important; }

.xforce-toast {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .55rem;
  padding: .85rem 1rem;
  border: 1px solid #86efac;
  border-left: 5px solid #22c55e;
  border-radius: .8rem;
  background: #f0fdf4;
  color: #065f46;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .2);
  font-weight: 800;
  opacity: 0;
  transform: translateY(-.75rem);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto;
}

.xforce-toast.visible { opacity: 1; transform: translateY(0); }
.xforce-toast.is-success { border-color: #86efac; border-left-color: #22c55e; background: #f0fdf4; color: #065f46; }
.xforce-toast.is-info { border-color: #bfdbfe; border-left-color: #3b82f6; background: #eff6ff; color: #1e40af; }
.xforce-toast.is-warning { border-color: #fde68a; border-left-color: #f59e0b; background: #fffbeb; color: #92400e; }
.xforce-toast.is-error { border-color: #fecaca; border-left-color: #ef4444; background: #fef2f2; color: #991b1b; }
.xforce-toast-icon {
  position: static !important;
  display: block !important;
  flex: 0 0 1.1rem;
  width: 1.1rem !important;
  height: 1.1rem !important;
  margin: 0 !important;
  fill: currentColor !important;
  transform: none !important;
}
.xforce-toast-message { min-width: 0; overflow-wrap: anywhere; }

.mt-map-editor {
  width: min(52rem, calc(100vw - 2rem));
}

.mt-map-background-upload {
  display: grid;
  align-content: start;
  gap: .55rem;
  padding: .8rem;
  border: 1px solid #cbd5e1;
  border-radius: .75rem;
  background: #f8fafc;
}

.mt-map-background-upload > span {
  color: #64748b;
  font-size: .82rem;
}

.mt-backup-error {
  color: #b91c1c;
  overflow-wrap: anywhere;
}

.mt-map-device-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  max-height: 18rem;
  overflow: auto;
  padding: .5rem;
  border: 1px solid #cbd5e1;
  border-radius: .75rem;
}

.mt-map-device-picker-tools {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto;
  gap: .55rem;
  align-items: end;
  margin-bottom: .55rem;
}

.mt-map-device-picker-tools > label { min-width: 0; }
.mt-map-device-picker-tools > div { display: flex; flex-wrap: wrap; gap: .4rem; }
.mt-map-device-picker-tools output {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
}

.mt-map-device-picker label {
  justify-content: flex-start;
  padding: .55rem;
  border-radius: .55rem;
  background: #f8fafc;
}

.mt-map-device-picker [hidden] { display: none !important; }

.mt-map-device-picker small { display: block; color: #64748b; }

.mt-secret-value {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem;
  border: 1px solid #cbd5e1;
  border-radius: .75rem;
  background: #f8fafc;
}

.mt-secret-value code {
  flex: 1;
  overflow-wrap: anywhere;
  user-select: all;
}

.mt-ca-file {
  display: grid;
  gap: .6rem;
}

.mt-ca-file > label:first-child {
  width: 100%;
}

.mt-file-button {
  position: relative;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: .68rem .9rem;
  border: 1px solid #9db5d3;
  border-radius: .7rem;
  background: #f8fbff;
  color: #184f91;
  cursor: pointer;
  font-weight: 800;
}

.mt-file-button:hover,
.mt-file-button:focus-within {
  border-color: #2473da;
  background: #eff6ff;
  outline: 2px solid rgba(36, 115, 218, .15);
}

.mt-file-button input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mt-ca-file [data-ca-file-status] {
  color: #667792;
  font-size: .82rem;
}

@media (max-width: 700px) {
  .mt-map-timeline { grid-template-columns: 1fr; }
  .mt-map-timeline label { grid-template-columns: 1fr; }
  .mt-map-timeline output { text-align: left; }
  .mt-map-zoom { grid-template-columns: 2.25rem minmax(6rem, 1fr) 2.25rem 3.8rem 2.25rem; height: auto; }
  .mt-map-zoom > span { grid-column: 1 / -1; }
  .mt-map-icon-actions { width: 100%; justify-content: center; }
  .mt-update-overview > header { align-items: stretch; flex-direction: column; }
  .mt-update-gates { grid-template-columns: 1fr; }
  .mt-company-filter label,
  .mt-lifecycle-state {
    align-items: stretch;
    flex-direction: column;
  }

  .mt-company-filter select {
    width: 100%;
    min-width: 0;
  }

  .mt-lifecycle-state span {
    text-align: left;
  }

  .mt-backup-options,
  .mt-map-device-picker {
    grid-template-columns: 1fr;
  }

  .mt-map-device-picker-tools { grid-template-columns: 1fr; }
  .mt-map-device-picker-tools output { grid-column: 1; }

  .mt-map-viewport {
    min-height: 26rem;
  }
}

@media (max-width: 1500px) {
  .mt-map-toolbar { grid-template-columns: minmax(12rem, 1fr) minmax(18rem, 1.3fr) auto; }
  .mt-map-toolbar .mt-map-icon-actions { grid-column: 3; grid-row: 1; }
}

@media (max-width: 1050px) {
  .mt-map-toolbar { grid-template-columns: minmax(12rem, 1fr) minmax(18rem, 1.4fr); }
  .mt-map-toolbar .mt-map-icon-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; }
  .mt-map-timeline { grid-template-columns: minmax(9rem, auto) minmax(15rem, 1fr) auto; }
  .mt-update-gates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .mt-map-layout.has-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .mt-map-detail-panel {
    position: relative;
    top: auto;
    max-height: none;
  }
}

@media (max-width: 700px) {
  .mt-map-toolbar { grid-template-columns: 1fr; }
  .mt-map-toolbar .mt-map-icon-actions { grid-column: 1; }
  .mt-map-timeline { grid-template-columns: 1fr; }
  .mt-update-gates { grid-template-columns: 1fr; }
}

@media (max-width: 1700px) {
  .mt-inventory-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mt-inventory-search { grid-column: span 2; }
  .mt-inventory-result { justify-self: end; }
}

@media (max-width: 1500px) {
  .mt-device-grid.mt-device-grid-columns[data-columns="4"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .mt-inventory-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-inventory-search { grid-column: 1 / -1; }
  .mt-update-runtime { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-device-grid.mt-device-grid-columns[data-columns="3"],
  .mt-device-grid.mt-device-grid-columns[data-columns="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .mt-inventory-controls { grid-template-columns: minmax(0, 1fr); }
  .mt-inventory-search { grid-column: auto; }
  .mt-inventory-result { justify-self: stretch; }
  .mt-device-grid.mt-device-grid-columns[data-columns] { grid-template-columns: minmax(0, 1fr); }
  .mt-device-pagination { align-items: stretch; flex-direction: column; }
  .mt-device-pagination > div { justify-content: space-between; }
  .mt-device-pagination label { flex: 1; justify-content: center; }
  .mt-update-runtime { grid-template-columns: minmax(0, 1fr); }
}

/* R10.9.1 device backup catalogue */
.mt-backup-toolbar { align-items:end; flex-wrap:wrap; gap:12px; }
.mt-backup-toolbar label:first-child { flex:1 1 300px; min-width:0; }
.mt-backup-toolbar select { max-width:100%; }
.mt-backup-summary { display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; margin:22px 0; padding:20px; border:1px solid #d4dfed; border-radius:16px; background:#fff; }
.mt-backup-summary h2 { margin:0 0 8px; }
.mt-backup-summary p { margin:6px 0; overflow-wrap:anywhere; }
.mt-backup-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
td.mt-backup-actions { display:table-cell; min-width:180px; }
td.mt-backup-actions button { margin:0 6px 6px 0; }
.mt-backup-path { overflow-wrap:anywhere; }
.mt-backup-detail { width:min(880px,calc(100vw - 32px)); max-width:880px; max-height:calc(100dvh - 48px); overflow:auto; }
.mt-backup-detail code,.mt-backup-detail pre { white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-word; }
.mt-backup-detail footer { flex-wrap:wrap; gap:8px; }

.mt-backup-plan { padding:20px; margin:18px 0; border:1px solid #c9d9ed; border-radius:16px; background:#f1f6ff; }
.mt-backup-plan h3 { margin:0 0 8px; }
.mt-backup-plan form { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin-top:12px; }
.mt-backup-plan label { display:grid; gap:6px; min-width:220px; }

/* R10.9.1 backup UI1: device picker, distinct actions and device modal. */
.xforce-mikrotik-page .mt-backup-browser { min-width:0; }
.xforce-mikrotik-page button.mt-backup-create { color:#087a62; border-color:#9bd6c6; background:#f0fdf8; }
.xforce-mikrotik-page button.mt-backup-browse { color:#155cca; border-color:#a9c7f4; background:#eff6ff; }
.xforce-mikrotik-page button.mt-backup-create:hover { background:#dcf8ec; }
.xforce-mikrotik-page button.mt-backup-browse:hover { background:#dceafe; }
.mt-backup-picker { padding:22px; border:2px solid #a9c8f4; border-radius:18px; background:#eef5ff; margin-bottom:20px; }
.mt-backup-picker-heading { display:flex; align-items:center; gap:14px; margin-bottom:18px; }
.mt-backup-picker-heading h2 { margin:0 0 4px; font-size:1.2rem; color:#183757; }
.mt-backup-picker-heading p { margin:0; color:#466282; }
.mt-backup-picker-icon { width:44px; height:44px; display:grid; place-items:center; flex:none; border-radius:12px; color:#fff; background:#1666d9; }
.mt-backup-picker-icon svg { width:26px; height:26px; }
.mt-backup-picker>label { display:block; font-weight:750; color:#244668; margin:0 0 8px; }
.mt-backup-select-wrap { position:relative; }
.xforce-mikrotik-page select.mt-backup-device-select { appearance:none; display:block; box-sizing:border-box; width:100%; max-width:100%; min-height:54px; margin:0; padding:12px 48px 12px 16px; border:2px solid #6a9ee7; border-radius:12px; background:#fff; color:#172b46; font:inherit; font-size:1.08rem; font-weight:750; cursor:pointer; }
.mt-backup-select-wrap>svg { position:absolute; right:17px; top:50%; width:17px; height:17px; transform:translateY(-50%) rotate(90deg); pointer-events:none; color:#155cca; }
.xforce-mikrotik-page .mt-backup-device-select:focus-visible { outline:3px solid #84b7ff; outline-offset:3px; }
.mt-backup-picker #mt-backup-device-hint { margin:10px 0 0; color:#526c88; font-size:.84rem; }
.mt-backup-browser .mt-backup-summary { margin:0 0 20px; padding:20px; border-left:4px solid #2c79de; }
.mt-backup-selected-device { display:flex; align-items:center; gap:14px; min-width:0; flex:1 1 280px; }
.mt-backup-selected-device>div { min-width:0; }
.mt-backup-router-icon { display:grid; place-items:center; flex:none; width:48px; height:48px; color:#246ac1; background:#eff5fd; border:1px solid #d1e1f6; border-radius:13px; }
.mt-backup-router-icon svg { width:34px; height:34px; }
.mt-backup-eyebrow { display:block; font-size:.72rem; font-weight:750; color:#527293; margin-bottom:5px; }
.mt-backup-selected-device h2 { overflow-wrap:anywhere; font-size:1.25rem; }
.mt-backup-selected-device p { font-size:.86rem; color:#5a718b; }
.xforce-mikrotik-page .mt-backup-labeled-action { display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.xforce-mikrotik-page .mt-backup-labeled-action>svg { width:20px; height:20px; flex:none; }
.mt-backup-history { margin:20px 0; min-width:0; }
.mt-backup-history-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:12px; }
.mt-backup-history-heading h3 { margin:0 0 5px; font-size:1rem; overflow-wrap:anywhere; }
.mt-backup-history-heading p { margin:0; color:#60738d; font-size:.82rem; }
.mt-backup-history-heading .mt-backup-toolbar { display:flex; align-items:end; gap:10px; margin:0; }
.mt-backup-history-heading .mt-backup-toolbar label { display:grid; gap:4px; flex:0 1 auto; min-width:0; font-size:.78rem; color:#526c88; }
.xforce-mikrotik-page .mt-backup-browser select:not(.mt-backup-device-select) { margin:0; padding:9px 30px 9px 10px; min-height:40px; border:1px solid #b6c9e3; border-radius:9px; background-color:#fff; color:#20354e; font:inherit; }
.mt-backup-browser .mt-table-wrap { overflow-x:auto; max-width:100%; }
.mt-backup-browser table { min-width:1050px; }
.mt-backup-browser td.mt-backup-actions { min-width:280px; }
.xforce-mikrotik-page .mt-backup-browser td.mt-backup-actions button { padding:8px 10px; font-size:.8rem; }
.mt-backup-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:12px; color:#60738d; font-size:.86rem; }
.mt-backup-pagination>div { display:flex; gap:8px; }
.mt-backup-browser details.mt-backup-plan { padding:16px 20px; margin:20px 0 12px; }
.mt-backup-plan>summary { display:flex; justify-content:space-between; gap:14px; align-items:center; cursor:pointer; list-style:none; }
.mt-backup-plan>summary::-webkit-details-marker { display:none; }
.mt-backup-plan>summary>span:first-child { display:grid; gap:5px; }
.mt-backup-plan>summary>span:first-child>span { font-size:.86rem; color:#526c88; }
.mt-backup-disclosure-label { display:flex; align-items:center; gap:8px; color:#155cca; font-size:.84rem; font-weight:700; white-space:nowrap; }
.mt-backup-disclosure-label svg { width:13px; height:13px; transition:transform .15s; }
.mt-backup-plan[open] .mt-backup-disclosure-label svg { transform:rotate(90deg); }
.mt-backup-plan[open]>summary { margin-bottom:14px; }
.mt-backup-info { border:1px solid #d6e1ef; border-radius:12px; background:#fff; padding:14px 20px; color:#49617a; }
.mt-backup-info>summary { cursor:pointer; font-weight:700; }
.mt-backup-info p { font-size:.86rem; line-height:1.55; }
.mt-backup-worker { margin:16px 0 0; }
.mt-backup-restore-help { padding:14px 16px; margin:16px 0; border:1px solid #c8dbf4; border-radius:12px; background:#f0f6ff; color:#25476a; font-size:.9rem; }
.mt-backup-restore-help h3 { margin:0 0 8px; font-size:1rem; }
.mt-backup-restore-help ol { list-style:decimal; margin:0; padding-left:21px; }
.mt-backup-restore-help li { margin:6px 0; line-height:1.6; }
.mt-backup-restore-help p { margin:10px 0 0; font-size:.8rem; line-height:1.5; }
body.xforce-backup-dialog-open { overflow:hidden; }
.mt-dialog-backdrop.mt-backup-backdrop { position:fixed; inset:0; z-index:1400; display:flex; align-items:center; justify-content:center; padding:24px; background:rgb(15 23 42 / 54%); }
.mt-backup-backdrop>.mt-dialog { box-sizing:border-box; max-height:calc(100dvh - 48px); overflow:auto; }
.mt-backup-backdrop>.mt-backup-modal { display:flex; flex-direction:column; width:min(1400px,calc(100vw - 48px)); max-width:none; padding:0; border:1px solid #b9cbe1; border-radius:18px; background:#f7f9fc; box-shadow:0 24px 80px rgb(15 23 42 / 30%); overflow:hidden; }
.mt-backup-modal>.mt-backup-modal-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; flex:none; padding:20px 24px; border-bottom:1px solid #d6e1ef; background:#fff; }
.mt-backup-modal-heading>div { min-width:0; }
.mt-backup-modal-heading span { font-size:.75rem; color:#55718f; }
.mt-backup-modal-heading h2 { margin:4px 0 0; font-size:1.4rem; overflow-wrap:anywhere; }
.xforce-mikrotik-page button.mt-backup-close { flex:none; width:40px; height:40px; padding:0; font-size:1.65rem; line-height:1; }
.mt-backup-modal-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:22px 24px; }
.mt-backup-modal>.mt-backup-modal-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0; padding:14px 24px; flex:none; border-top:1px solid #d6e1ef; background:#fff; }
.mt-backup-modal-footer span { font-size:.8rem; color:#60738d; }
.mt-backup-backdrop>.mt-backup-password-dialog { width:min(680px,calc(100vw - 48px)); }
.mt-backup-password-dialog label { display:grid; gap:7px; }
.mt-backup-password-dialog label small { color:#60738d; font-size:.8rem; }
.mt-backup-password-dialog .mt-secret-value { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:14px; border:1px solid #d6e1ef; border-radius:10px; background:#f8fafc; }
.mt-backup-password-dialog .mt-secret-value code { flex:1 1 260px; min-width:0; overflow-wrap:anywhere; white-space:normal; }
.mt-backup-backdrop .mt-dialog:focus { outline:none; }
.mt-backup-backdrop :is(button,a,input,select,summary):focus-visible { outline:3px solid #84b7ff; outline-offset:3px; }
@media (max-width:700px) {
  .mt-backup-picker { padding:16px; }
  .mt-backup-picker-heading { align-items:flex-start; }
  .mt-backup-browser .mt-backup-summary { padding:16px; }
  .mt-backup-plan>summary { align-items:flex-start; flex-direction:column; }
  .mt-backup-history-heading>div { width:100%; }
  .mt-backup-history-heading .mt-backup-toolbar { justify-content:space-between; }
  .mt-backup-browser .mt-backup-plan label { min-width:0; width:100%; }
  .mt-dialog-backdrop.mt-backup-backdrop { padding:12px; }
  .mt-backup-backdrop>.mt-dialog { max-height:calc(100dvh - 24px); }
  .mt-backup-backdrop>.mt-backup-modal { width:calc(100vw - 24px); }
  .mt-backup-modal>.mt-backup-modal-heading,.mt-backup-modal-body,.mt-backup-modal>.mt-backup-modal-footer { padding:14px; }
  .mt-backup-modal-footer { flex-wrap:wrap; }
  .mt-backup-modal-footer span { flex:1 1 180px; }
}

/* R10.9.2: optional public CA transfer, with manual input always available. */
.xforce-mikrotik-shell .mt-ca-auto-option { flex-wrap: wrap; }
.xforce-mikrotik-shell .mt-ca-auto-option small { flex-basis: 100%; color: #60728e; font-weight: 400; }
.xforce-mikrotik-shell .mt-ca-auto { padding: 18px; margin-bottom: 16px; border: 1px solid #bfd4f4; border-left: 4px solid #176bef; border-radius: 12px; background: #f0f6ff; }
.xforce-mikrotik-shell .mt-ca-auto.good { border-color: #9adbbc; border-left-color: #059669; background: #f0fdf6; }
.xforce-mikrotik-shell .mt-ca-auto.manual { border-color: #ead09a; border-left-color: #b7791f; background: #fffaf0; }
.xforce-mikrotik-shell .mt-ca-auto p { margin: 8px 0; line-height: 1.55; }
.xforce-mikrotik-shell .mt-ca-auto small { display: block; overflow-wrap: anywhere; }
.xforce-mikrotik-shell .mt-ca-auto button { margin-top: 10px; }

/* R10.9.3 alert policy and ICMP measurements */
.mt-alert-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:16px;margin-top:24px}
.mt-alert-rule {background:#fff;border:1px solid #dce5ee;border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:12px}
.mt-alert-rule h3 {margin:0 0 6px}.mt-alert-rule header span {color:#64748b;font-size:12px}
.mt-alert-rule label {display:flex;flex-direction:column;gap:5px}.mt-alert-rule label.check {flex-direction:row;align-items:center}
.mt-alert-rule input:not([type=checkbox]),.mt-alert-rule select {min-width:0;width:100%;padding:8px;border:1px solid #cbd5e1;border-radius:6px}
.mt-alert-numbers {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;font-size:12px}
.mt-alert-rule footer {display:flex;gap:10px;flex-wrap:wrap;margin-top:auto}
.mt-alert-table {overflow:auto}.mt-alert-table table {width:100%;border-collapse:collapse}
.mt-alert-table th,.mt-alert-table td {text-align:left;padding:10px;border-bottom:1px solid #e2e8f0}.mt-alert-table small {display:block;color:#64748b}
.mt-link-ping-config {border:1px solid #cbd5e1;border-radius:8px;padding:12px}.mt-link-ping-config p {font-size:12px}
[data-live-link-ping] {paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round;fill:#075985}
