[data-device-manager-root] {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.device-manager-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 16, 22, 0.55);
  backdrop-filter: blur(2px);
}

.device-manager-overlay.is-open {
  display: flex;
}

.device-manager-modal {
  width: min(1120px, calc(100vw - 36px));
  max-height: calc(100vh - 52px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #d9e2e6;
  border-radius: 14px;
  padding: 20px;
  color: #173140;
  box-shadow: 0 22px 44px rgba(4, 20, 31, 0.22);
}

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

.device-manager-header h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.device-manager-header p {
  margin: 6px 0 0;
  color: #567082;
  font-size: 0.92rem;
}

.device-manager-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.84rem;
  color: #456170;
}

.device-manager-notice {
  border-radius: 8px;
  border: 1px solid #d3dde2;
  padding: 9px 10px;
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.device-manager-notice.is-warning {
  border-color: #f0d9b0;
  background: #fff8ea;
  color: #7a4f0f;
}

.device-manager-notice.is-success {
  border-color: #b6e0cb;
  background: #eefaf3;
  color: #1e6541;
}

.device-manager-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.device-manager-fallback-note {
  margin: 0 0 14px;
  border: 1px dashed #c7d7e1;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f4f9fc;
}

.device-manager-fallback-note h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.device-manager-fallback-note p {
  margin: 0;
  font-size: 0.84rem;
  color: #446172;
}

.device-manager-subcopy {
  margin: 0 0 10px;
  color: #567082;
  font-size: 0.88rem;
}

.device-manager-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.device-manager-role-card {
  border: 1px solid #d6e1e7;
  border-radius: 10px;
  padding: 12px;
  background: #f8fbfd;
}

.device-manager-role-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.device-manager-role-card h3 {
  margin: 0;
  font-size: 1rem;
}

.device-manager-role-copy {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: #627c8c;
}

.device-manager-role-assignment {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #253f4d;
}

.device-manager-role-card label {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
  font-size: 0.83rem;
  color: #274252;
}

.device-manager-role-card select {
  width: 100%;
}

.device-manager-role-hint {
  margin: 0 0 8px;
  color: #5d7787;
  font-size: 0.8rem;
}

.device-manager-role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.device-manager-role-fallbacks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.device-manager-chip {
  border-radius: 999px;
  font-size: 0.74rem;
  line-height: 1;
  padding: 5px 8px;
  border: 1px solid transparent;
  font-weight: 600;
}

.device-manager-chip.is-online {
  background: #eaf8ef;
  color: #0f7641;
  border-color: #b6e2c5;
}

.device-manager-chip.is-offline {
  background: #fff0ef;
  color: #a42626;
  border-color: #efc5c3;
}

.device-manager-chip.is-pending {
  background: #f2f5f7;
  color: #4d6573;
  border-color: #cfdde5;
}

.device-manager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.device-manager-table th,
.device-manager-table td {
  border: 1px solid #dce6ec;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.device-manager-table th {
  background: #f2f7fa;
  color: #314c5c;
}

.device-manager-wedge {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dce6ec;
}

.device-manager-wedge h3 {
  margin: 0 0 6px;
  font-size: 0.96rem;
}

.device-manager-wedge p {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #5b7586;
}

.device-manager-wedge input {
  width: min(420px, 100%);
}

.device-manager-wedge-result {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #173140;
}

.device-manager-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .device-manager-meta {
    grid-template-columns: 1fr;
  }

  .device-manager-role-grid {
    grid-template-columns: 1fr;
  }
}
