.error-tray {
  position: fixed;
  right: 20px;
  bottom: 38px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.error-notice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 36px 14px 14px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #ef4444;
  border-radius: 10px;
  box-shadow: 
    0 12px 28px -4px rgba(15, 23, 42, 0.12),
    0 4px 12px -2px rgba(15, 23, 42, 0.08),
    0 0 18px -2px rgba(239, 68, 68, 0.22);
  color: #0f172a;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  overflow: hidden;
  animation: errorNoticeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: 
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease;
}

.error-notice:hover {
  border-color: #dc2626;
  box-shadow: 
    0 16px 36px -4px rgba(15, 23, 42, 0.16),
    0 0 24px rgba(239, 68, 68, 0.35);
  transform: translateY(-2px);
}

.error-notice:active {
  transform: translateY(0) scale(0.99);
}

/* Glowing red left vertical accent bar */
.error-notice-accent {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #ef4444 0%, #f43f5e 50%, #dc2626 100%);
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/* Red Alert Icon Badge */
.error-notice-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
  transition: transform 0.2s ease;
}

.error-notice:hover .error-notice-icon-badge {
  transform: scale(1.08);
  background: #fee2e2;
}

.error-notice-content {
  flex: 1;
  min-width: 0;
}

.error-notice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.error-notice-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.error-notice-code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 1.5px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.error-notice-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
  word-break: break-word;
}

/* Micro-dismiss close button */
.error-notice-dismiss {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.error-notice-dismiss:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: scale(1.08);
}

/* Fade out state */
.error-notice.is-fading {
  opacity: 0 !important;
  transform: translateY(6px) scale(0.98);
  transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1), transform 1.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Instant dismiss on click */
.error-notice.is-dismissing {
  opacity: 0 !important;
  transform: scale(0.92) !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
  pointer-events: none !important;
}

@keyframes errorNoticeIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
