/* Fatal error modal — "Something went wrong" + Try Again.
   Calm, centered, dark-first. Reuses global tokens where they exist and
   falls back to the neutral chip palette so no failure is ever silent. */
.fem {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.fem.open { display: flex; }
.fem .fem-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: fem-fade 0.18s ease-out;
}
.fem .fem-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--bg-card, #171717);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 24px;
  padding: 40px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  font-family: var(--font-body, system-ui, sans-serif);
  animation: fem-rise 0.22s ease-out;
}
.fem .fem-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger, #f87171);
}
.fem .fem-icon svg { width: 30px; height: 30px; }
.fem .fem-title {
  margin: 0 0 8px;
  font-family: var(--font-display, inherit);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary, #fcf6f5);
}
.fem .fem-sub {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted, #9a9a9a);
}
.fem .fem-retry {
  margin-top: 24px;
  min-width: 160px;
  padding: 11px 24px;
  border: none;
  border-radius: 999px;
  background: var(--primary, #7c6cfa);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.fem .fem-retry:hover { opacity: 0.88; }
.fem .fem-retry:focus-visible {
  outline: 2px solid var(--primary, #7c6cfa);
  outline-offset: 2px;
}

@keyframes fem-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fem-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}