/*
  Alert 09 — Recovery Alert — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

:root {
  --alert-accent: #39ff14;
  --alert-fg: oklch(0.17 0 0);
  --alert-muted: oklch(0.48 0 0);
  --alert-border: oklch(0.92 0 0);
  --alert-border-strong: oklch(0.86 0 0);
  --alert-soft: oklch(0.955 0 0);
  --alert-panel: oklch(0.985 0 0);
  --alert-ink-hover: oklch(0.3 0 0);
  --alert-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The root is the size container the layout responds to. */
.alert09 {
  container-type: inline-size;
  overflow: hidden;
  border: 1px solid var(--alert-border);
  border-radius: 1rem;
  background-color: #ffffff;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.alert09 p {
  margin: 0;
}

.alert09__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.alert09__lead {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

/* The countdown ring sits on a near-black disc so the neon progress reads
   with full contrast; it drains linearly, one second per step. */
.alert09__ring {
  position: relative;
  display: flex;
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: oklch(0.18 0 0);
  color: #ffffff;
}

.alert09__ring svg.alert09__ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.alert09__track {
  stroke: rgba(255, 255, 255, 0.14);
}

.alert09__progress {
  stroke: var(--alert-accent);
  transition: stroke-dashoffset 1s linear;
}

.alert09[data-phase="failed"] .alert09__ring {
  background-color: oklch(0.96 0.025 25);
  color: oklch(0.52 0.19 27);
}

.alert09[data-phase="failed"] .alert09__track {
  stroke: oklch(0.88 0.05 25);
}

.alert09__center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--alert-mono);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.alert09__center svg {
  display: block;
}

.alert09[data-phase="recovered"] .alert09__center {
  color: var(--alert-accent);
  animation: alert09-pop 360ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

.alert09__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
  animation: alert09-spin 700ms linear infinite;
}

.alert09__countdown {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--alert-muted);
}

.alert09[data-phase="recovered"] .alert09__countdown {
  visibility: hidden;
}

.alert09__countdown--wide {
  display: none;
  margin-top: 0.375rem !important;
}

.alert09__text {
  min-width: 0;
  flex: 1;
}

.alert09__title {
  font-size: 15px;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--alert-fg);
}

.alert09__detail {
  margin-top: 0.25rem !important;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--alert-muted);
}

.alert09__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert09__primary,
.alert09__offline {
  display: flex;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  transition:
    background-color 150ms,
    color 150ms;
}

.alert09__primary {
  border: 0;
  background-color: var(--alert-fg);
  color: #ffffff;
}

.alert09__primary:hover {
  background-color: var(--alert-ink-hover);
}

.alert09__primary[aria-disabled="true"],
.alert09__primary[aria-disabled="true"]:hover {
  cursor: default;
  background-color: var(--alert-soft);
  color: var(--alert-muted);
}

.alert09__offline {
  border: 1px solid var(--alert-border-strong);
  background-color: #ffffff;
  color: var(--alert-fg);
}

.alert09__offline[hidden] {
  display: none;
}

.alert09__offline:hover {
  background-color: var(--alert-soft);
}

.alert09__primary:focus-visible,
.alert09__offline:focus-visible {
  outline: 2px solid var(--alert-fg);
  outline-offset: 2px;
}

.alert09__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--alert-border);
  background-color: var(--alert-panel);
  padding: 0.5rem 1rem;
}

.alert09__reference {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--alert-muted);
}

.alert09__reference code {
  font-family: var(--alert-mono);
  color: var(--alert-fg);
}

.alert09__copy {
  display: flex;
  height: 1.75rem;
  flex-shrink: 0;
  align-items: center;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  padding: 0 0.5rem;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--alert-fg);
  cursor: pointer;
  outline: none;
  transition: background-color 150ms;
}

.alert09__copy:hover {
  background-color: #ffffff;
}

.alert09__copy:focus-visible {
  outline: 2px solid var(--alert-fg);
  outline-offset: 1px;
}

@keyframes alert09-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes alert09-pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@container (min-width: 24rem) {
  .alert09__actions {
    flex-direction: row;
  }
  .alert09__primary,
  .alert09__offline {
    height: 2.25rem;
  }
}

@container (min-width: 32rem) {
  .alert09__body {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
  }
  .alert09__lead {
    display: contents;
  }
  .alert09__countdown--narrow {
    display: none;
  }
  .alert09__countdown--wide {
    display: block;
  }
  .alert09__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .alert09__footer {
    padding: 0.5rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alert09__progress {
    transition: none;
  }
  .alert09[data-phase="recovered"] .alert09__center,
  .alert09__spinner {
    animation: none;
  }
}

/*
  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;
}
.alert09-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}
.alert09-layout__page {
  width: 100%;
  max-width: 45rem;
}
.alert09-layout__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}
.alert09-layout__heading {
  font-size: 15px;
  font-weight: 600;
  color: oklch(0.205 0 0);
}
.alert09-layout__people {
  font-size: 0.75rem;
  line-height: 1rem;
  color: oklch(0.556 0 0);
}
.alert09-layout__page .alert09 {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.alert09-layout__messages {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  background: #ffffff;
}
.alert09-layout__message {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.alert09-layout__message + .alert09-layout__message {
  border-top: 1px solid oklch(0.97 0 0);
}
.alert09-layout__author {
  width: 4rem;
  flex-shrink: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: oklch(0.205 0 0);
}
.alert09-layout__text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: oklch(0.439 0 0);
}
.alert09-layout__time {
  flex-shrink: 0;
  font-size: 0.75rem;
  line-height: 1rem;
  font-variant-numeric: tabular-nums;
  color: oklch(0.708 0 0);
}
@media (min-width: 640px) {
  .alert09-layout {
    padding: 2.5rem;
  }
}
