body:has(.panel-alert[open]) {
  overflow: hidden;
}

dialog.panel-alert {
  --alert-positive: #46652f;
  --alert-danger: #a7334a;
  --alert-accent: var(--alert-positive);
  --alert-divider: #dce3db;
  position: fixed;
  inset: 0;
  width: min(18rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .62);
  border-radius: 1.05rem;
  background: #f7faf6;
  color: #1f2937;
  font-family: Poppins, system-ui, sans-serif;
  text-align: center;
}

dialog.panel-alert[open] {
  display: flex;
  flex-direction: column;
}

.panel-alert::backdrop {
  background: rgb(15 23 42 / .34);
  backdrop-filter: blur(2px);
}

.panel-alert[data-tone="error"] {
  --alert-accent: var(--alert-danger);
}

.panel-alert[data-tone="warning"] {
  --alert-accent: #936322;
}

.panel-alert[data-tone="info"] {
  --alert-accent: #3c6279;
}

.panel-alert__copy {
  min-height: 0;
  padding: .98rem .9rem .87rem;
  overflow-y: auto;
  overflow-wrap: anywhere;
}

.panel-alert__icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  margin: 0 auto .54rem;
  color: var(--alert-accent);
  font-size: 1.64rem;
  line-height: 1;
}

.panel-alert__icon::before {
  display: block;
  line-height: 1;
}

.panel-alert__copy h2 {
  margin: 0;
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.35;
}

.panel-alert__copy p {
  margin: .31rem 0 0;
  color: #515e57;
  font-size: .77rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: pre-line;
}

.panel-alert__actions {
  display: flex;
  flex: none;
  border-top: 1px solid var(--alert-divider);
}

.panel-alert__actions button {
  min-width: 0;
  min-height: 2.75rem;
  flex: 1;
  padding: .44rem .42rem;
  border: 0;
  background: transparent;
  color: var(--alert-positive);
  font: inherit;
  font-size: .79rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.panel-alert__actions button[hidden] {
  display: none;
}

.panel-alert__actions [data-alert-cancel] {
  border-inline-end: 1px solid var(--alert-divider);
  color: #46564d;
  font-weight: 500;
}

.panel-alert[data-destructive] [data-alert-accept] {
  color: var(--alert-danger);
}

.panel-alert__actions button:focus-visible {
  outline: none;
  background: #e6eee3;
  text-decoration: underline;
  text-underline-offset: .19em;
}

.panel-alert__actions button:active {
  background: #e6eee3;
}

@media (hover: hover) {
  .panel-alert__actions button:hover {
    background: #edf3eb;
  }
}
