/* Stability layer: viewport modals and lightweight transitions only. */
.acn-rule-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 6, 10, 0.92);
  animation: acnRuleBackdropIn 160ms ease-out both;
}

.acn-rule-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: #12151e;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
  animation: acnRulePanelIn 200ms cubic-bezier(.16, 1, .3, 1) both;
}

.acn-rule-panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #12151e;
}

.acn-rule-panel-eyebrow {
  margin: 0 0 4px;
  color: #60a5fa;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.acn-rule-panel-title {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.15;
}

.acn-rule-panel-summary {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.55;
}

.acn-rule-panel-close {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #1a1d27;
  color: #cbd5e1;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.acn-rule-panel-close:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: #232736;
  color: #fff;
  transform: rotate(4deg);
}

.acn-rule-panel-body {
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 24px 24px;
}

.acn-rule-panel-body > div {
  display: block !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-top: 0 !important;
}

.acn-rule-overlay.acn-closing {
  animation: acnRuleBackdropOut 130ms ease-in both;
}

.acn-rule-overlay.acn-closing .acn-rule-panel {
  animation: acnRulePanelOut 130ms ease-in both;
}

@keyframes acnRuleBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes acnRuleBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes acnRulePanelIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes acnRulePanelOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(.99); }
}

@media (max-width: 640px) {
  .acn-rule-overlay { padding: 10px; }
  .acn-rule-panel { max-height: calc(100dvh - 20px); border-radius: 16px; }
  .acn-rule-panel-header { padding: 18px 18px 15px; }
  .acn-rule-panel-body { max-height: calc(100dvh - 130px); padding: 4px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .acn-rule-overlay,
  .acn-rule-panel,
  .acn-rule-overlay.acn-closing,
  .acn-rule-overlay.acn-closing .acn-rule-panel {
    animation-duration: 1ms !important;
  }
}
