/*
  Modal 02 — Destructive Action Dialog — standalone HTML/CSS/JS.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

:root {
  --danger-fg: oklch(0.17 0 0);
  --danger-muted: oklch(0.52 0 0);
  --danger-line: oklch(0.91 0 0);
  --danger-soft: oklch(0.97 0 0);
  --danger-ink: oklch(0.47 0.2 27);
  --danger-wash: oklch(0.97 0.02 25);
  --danger-edge: oklch(0.88 0.06 25);
  --danger-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.modal02 {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.modal02[hidden] {
  display: none;
}

.modal02 p,
.modal02 h2,
.modal02 ul {
  margin: 0;
}

.modal02 ul {
  padding: 0;
  list-style: none;
}

/* Heavier dim than a routine dialog: this one should stop you. */
.modal02__backdrop {
  position: fixed;
  inset: 0;
  background-color: oklch(0.2 0 0 / 0.55);
  animation: modal02-fade-in 200ms ease-out both;
}

.modal02[data-state="closing"] .modal02__backdrop {
  animation: modal02-fade-out 150ms ease-in both;
}

.modal02__positioner {
  position: relative;
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* No bounce here — it rises once and settles. */
.modal02__panel {
  position: relative;
  width: 100%;
  max-width: 30rem;
  overflow: hidden;
  border: 1px solid var(--danger-line);
  border-radius: 1rem;
  background-color: #ffffff;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.4);
  animation: modal02-lift 220ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.modal02[data-state="closing"] .modal02__panel {
  animation: modal02-drop 150ms ease-in both;
}

.modal02__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-bottom: 1px solid var(--danger-edge);
  background-color: var(--danger-wash);
  padding: 1rem 1.5rem;
}

.modal02__glyph {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin-top: 0.125rem;
  border-radius: 0.5rem;
  background-color: #ffffff;
  box-shadow: 0 0 0 1px var(--danger-edge);
  color: var(--danger-ink);
}

.modal02 svg {
  display: block;
}

.modal02__glyph svg {
  width: 1rem;
  height: 1rem;
}

.modal02__title {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--danger-fg);
}

.modal02__description {
  margin-top: 0.125rem !important;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--danger-muted);
}

.modal02__body {
  padding: 1.25rem 1.5rem;
}

.modal02__consequence {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--danger-fg);
}

.modal02__consequence + .modal02__consequence {
  margin-top: 0.5rem;
}

.modal02__consequence svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
  color: var(--danger-ink);
}

.modal02__field {
  margin-top: 1.25rem;
}

.modal02__label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--danger-fg);
}

.modal02__phrase {
  border-radius: 0.25rem;
  background-color: var(--danger-soft);
  padding: 0.125rem 0.375rem;
  font-family: var(--danger-mono);
  font-size: 13px;
  color: var(--danger-fg);
}

.modal02__input {
  width: 100%;
  height: 2.5rem;
  margin-top: 0.5rem;
  border: 1px solid var(--danger-line);
  border-radius: 0.5rem;
  background: transparent;
  padding: 0 0.75rem;
  font-family: var(--danger-mono);
  font-size: 0.875rem;
  color: var(--danger-fg);
  outline: none;
  transition:
    border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal02__input:focus-visible {
  border-color: var(--danger-fg);
  box-shadow: 0 0 0 2px oklch(0.17 0 0 / 0.12);
}

.modal02__hint {
  margin-top: 0.375rem !important;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--danger-muted);
}

.modal02__actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  border-top: 1px solid var(--danger-line);
  background-color: oklch(0.97 0 0 / 0.6);
  padding: 1rem 1.5rem;
}

.modal02__keep,
.modal02__delete {
  display: flex;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
  outline: none;
  transition:
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal02__keep {
  border: 1px solid var(--danger-line);
  background-color: #ffffff;
  font-weight: 500;
  color: var(--danger-fg);
}

.modal02__keep:hover {
  background-color: var(--danger-soft);
}

.modal02__delete {
  border: 0;
  background-color: var(--danger-ink);
  font-weight: 600;
  color: #ffffff;
}

.modal02__delete svg {
  width: 1rem;
  height: 1rem;
}

.modal02__delete:hover {
  background-color: oklch(0.42 0.2 27);
}

.modal02__delete[aria-disabled="true"] {
  cursor: not-allowed;
  background-color: var(--danger-soft);
  color: oklch(0.68 0 0);
}

.modal02__keep:focus-visible {
  outline: 2px solid var(--danger-fg);
  outline-offset: 2px;
}

.modal02__delete:focus-visible {
  outline: 2px solid var(--danger-ink);
  outline-offset: 2px;
}

@keyframes modal02-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal02-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes modal02-lift {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes modal02-drop {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (min-width: 40rem) {
  .modal02__actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal02__panel {
    animation-name: modal02-fade-in;
    animation-duration: 120ms;
  }
  .modal02[data-state="closing"] .modal02__panel {
    animation-name: modal02-fade-out;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
p {
  margin: 0;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.modal02-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
}
.modal02-layout__app {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 60rem;
  height: 42rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 18px 44px -20px rgba(0, 0, 0, 0.18);
  transform: translateZ(0);
}
@media (min-width: 25rem) {
  .modal02-layout__app {
    height: 36rem;
  }
}
.modal02-layout__head {
  border-bottom: 1px solid oklch(0.97 0 0);
  padding: 0.875rem 1.5rem;
}
.modal02-layout__title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: oklch(0.205 0 0);
}
.modal02-layout__sub {
  font-size: 0.75rem;
  line-height: 1rem;
  color: oklch(0.556 0 0);
}
.modal02-layout__body {
  padding: 1.5rem;
}
.modal02-layout__list {
  overflow: hidden;
  border: 1px solid oklch(0.97 0 0);
  border-radius: 0.75rem;
}
.modal02-layout__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.modal02-layout__row + .modal02-layout__row {
  border-top: 1px solid oklch(0.97 0 0);
}
.modal02-layout__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: oklch(0.205 0 0);
}
.modal02-layout__meta {
  display: block;
  font-size: 0.75rem;
  line-height: 1rem;
  color: oklch(0.556 0 0);
}
.modal02-layout__badge {
  flex-shrink: 0;
  border-radius: 9999px;
  background: oklch(0.97 0 0);
  padding: 0.125rem 0.5rem;
  font-size: 11px;
  line-height: 1rem;
  font-weight: 500;
  color: oklch(0.439 0 0);
}
.modal02-layout__danger {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  border: 1px solid oklch(0.88 0.06 25);
  border-radius: 0.75rem;
  background: oklch(0.97 0.02 25);
  padding: 0.75rem 1rem;
}
.modal02-layout__danger-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: oklch(0.205 0 0);
}
.modal02-layout__danger-note {
  font-size: 0.75rem;
  line-height: 1rem;
  color: oklch(0.439 0 0);
}
.modal02-layout__danger-button {
  display: flex;
  height: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  border: 1px solid oklch(0.8 0.1 27);
  border-radius: 0.5rem;
  background: #ffffff;
  padding: 0 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: oklch(0.47 0.2 27);
  cursor: pointer;
  outline: none;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal02-layout__danger-button:hover {
  background: oklch(0.95 0.03 25);
}
.modal02-layout__danger-button:focus-visible {
  outline: 2px solid oklch(0.47 0.2 27);
  outline-offset: 2px;
}
@media (min-width: 40rem) {
  .modal02-layout__app {
    height: 27.5rem;
  }
}
