.flash-container {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100vw - 32px));
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
  animation: flash-in 280ms var(--ease) both;
  pointer-events: auto;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flash.is-dismissing {
  animation: flash-out 180ms var(--ease) both;
}

@keyframes flash-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

.flash-icon {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.flash-message {
  flex: 1;
}

.flash-dismiss {
  appearance: none;
  border: 0;
  background: transparent;
  color: currentColor;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0;
  cursor: pointer;
  opacity: 0.72;
}

.flash-dismiss::before {
  content: "×";
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

.flash-dismiss:hover,
.flash-dismiss:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: currentColor;
  opacity: 1;
}

.flash-dismiss:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.flash-notice,
.flash-success {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(34, 217, 160, 0.18);
}
.flash-notice .flash-icon,
.flash-success .flash-icon {
  background: rgba(34, 217, 160, 0.12);
}

.flash-alert,
.flash-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 91, 106, 0.18);
}
.flash-alert .flash-icon,
.flash-error .flash-icon {
  background: rgba(255, 91, 106, 0.12);
}

.flash-warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(255, 176, 58, 0.18);
}
.flash-warning .flash-icon {
  background: rgba(255, 176, 58, 0.12);
}

.flash-info {
  color: var(--info);
  background: var(--info-soft);
  border-color: rgba(78, 168, 232, 0.18);
}
.flash-info .flash-icon {
  background: rgba(78, 168, 232, 0.12);
}
