.polanger-shield-trigger {
  position: fixed;
  top: 54px;
  right: 20px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb 0%, #4338ca 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.26);
  z-index: 999996;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.polanger-shield-trigger:hover,
.polanger-shield-trigger:focus-visible {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 22px 42px rgba(37, 99, 235, 0.34);
}

.polanger-shield-trigger:focus-visible {
  outline: 0;
}

.polanger-shield-trigger__icon {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.polanger-shield-trigger .dashicons {
  font-size: 22px;
  width: 22px;
  height: 22px;
}

.polanger-shield-count {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  padding: 0 5px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.88);
  z-index: 3;
}

.polanger-shield-pulse {
  position: absolute;
  inset: -6px;
  border: 2px solid rgba(37, 99, 235, 0.32);
  border-radius: 999px;
  animation: polangerShieldPulse 1.5s infinite;
}

@keyframes polangerShieldPulse {
  from {
    transform: scale(0.92);
    opacity: 1;
  }

  to {
    transform: scale(1.34);
    opacity: 0;
  }
}

.polanger-shield-panel {
  position: fixed;
  top: 122px;
  right: 20px;
  width: min(380px, calc(100vw - 28px));
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow:
    0 26px 64px rgba(15, 23, 42, 0.18),
    0 8px 18px rgba(15, 23, 42, 0.1);
  z-index: 999995;
  display: none;
  gap: 14px;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.polanger-shield-panel.is-open {
  display: flex;
}

.polanger-shield-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.polanger-shield-panel__intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.polanger-shield-panel__badge {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe 0%, #c7d2fe 100%);
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.polanger-shield-panel__badge .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.polanger-shield-panel__copy strong {
  display: block;
  margin: 2px 0 4px;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.2;
}

.polanger-shield-panel__copy p {
  margin: 0;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.55;
}

.polanger-shield-panel__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: #eef2ff;
  color: #4338ca;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.polanger-shield-panel__close:hover,
.polanger-shield-panel__close:focus-visible {
  background: #dbeafe;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.polanger-shield-panel__close:focus-visible {
  outline: 0;
}

.polanger-shield-panel__actions {
  display: grid;
  gap: 10px;
}

.polanger-shield-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.polanger-shield-action-card {
  width: 100%;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.polanger-shield-action-card:hover,
.polanger-shield-action-card:focus-visible {
  border-color: rgba(67, 56, 202, 0.32);
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

.polanger-shield-action-card:focus-visible {
  outline: 0;
}

.polanger-shield-action-card__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 18px;
}

.polanger-shield-action-card__content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.polanger-shield-action-card__title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.polanger-shield-action-card__text {
  color: #475569;
  font-size: 12.5px;
  line-height: 1.55;
}

.polanger-shield-action-settings {
  flex: 0 0 auto;
  width: 48px;
  min-width: 48px;
  border-radius: 16px;
  border: 1px solid #dbe4f0;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  color: #4338ca;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.polanger-shield-action-settings:hover,
.polanger-shield-action-settings:focus-visible {
  border-color: rgba(67, 56, 202, 0.32);
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.12);
  color: #1d4ed8;
  transform: translateY(-1px);
}

.polanger-shield-action-settings:focus-visible {
  outline: 0;
}

.polanger-shield-action-settings .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.polanger-shield-manage-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  text-decoration: none;
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.polanger-shield-manage-link:hover,
.polanger-shield-manage-link:focus {
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(99, 102, 241, 0.12);
}

.polanger-shield-manage-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.polanger-shield-manage-title {
  color: #1e293b;
  font-weight: 700;
  line-height: 1.3;
}

.polanger-shield-manage-text {
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.polanger-shield-manage-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.24);
}

body.polanger-shield-selecting * {
  cursor: crosshair !important;
}

.polanger-shield-hover {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
}

.polanger-shield-test-highlight {
  outline: 3px solid #2563eb !important;
  outline-offset: 2px !important;
  animation: polangerShieldTestPulse 1.4s infinite;
}

@keyframes polangerShieldTestPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.polanger-shield-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 999997;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.polanger-shield-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
}

.polanger-shield-modal {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
}

.polanger-shield-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.polanger-shield-modal-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.25;
}

.polanger-shield-modal-body {
  padding: 20px;
}

.polanger-shield-modal-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.polanger-shield-user-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  padding: 12px;
  margin: 10px 0;
  background: #fff;
  display: grid;
  gap: 8px;
}

.polanger-shield-user-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.polanger-shield-user-item input {
  margin-top: 2px;
}

.polanger-shield-help-text {
  margin: 0 0 12px;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.6;
}

.polanger-shield-users-title {
  margin: 10px 0 6px;
  color: #0f172a;
}

.polanger-shield-selector-summary {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  padding: 12px 14px;
  margin: 0 0 12px;
}

.polanger-shield-target-title {
  margin: 0 0 6px;
  color: #0f172a;
}

.polanger-shield-target-raw {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}

.polanger-shield-target-raw code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.polanger-shield-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.polanger-shield-modal textarea {
  width: 100%;
  resize: vertical;
  min-height: 130px;
  border-radius: 14px;
  padding: 12px 14px;
}

.polanger-shield-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.polanger-shield-toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  max-width: min(340px, calc(100vw - 24px));
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999998;
}

.polanger-shield-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.polanger-shield-toast.is-error {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

@media (max-width: 782px) {
  .polanger-shield-trigger {
    top: auto;
    bottom: 12px;
    right: 12px;
    width: 54px;
    height: 54px;
  }

  .polanger-shield-panel {
    top: auto;
    bottom: 78px;
    right: 12px;
    width: min(360px, calc(100vw - 24px));
    padding: 12px;
  }

  .polanger-shield-panel__header {
    align-items: flex-start;
  }

  .polanger-shield-panel__intro {
    gap: 10px;
  }

  .polanger-shield-action-card {
    padding: 12px;
  }

  .polanger-shield-action-row {
    grid-template-columns: 1fr;
  }

  .polanger-shield-action-settings {
    width: 100%;
    min-height: 44px;
  }

  .polanger-shield-modal-wrap {
    padding: 12px;
    align-items: flex-end;
  }

  .polanger-shield-modal {
    width: min(100%, 100vw);
    max-height: calc(100vh - 16px);
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }

  .polanger-shield-modal-header,
  .polanger-shield-modal-body {
    padding: 16px;
  }
}
