/* Shared application feedback. Warnings and errors remain visible; lower
   severity notices may opt into a quiet fade with data-auto-dismiss. */
.app-notice {
  box-sizing: border-box;
  display: block;
  width: fit-content;
  max-width: min(100%, 44rem);
  margin: 5px 0 9px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left-width: 3px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  color: #d9dce3;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: left;
  transition: opacity 180ms ease-out;
}

.app-notice[hidden] { display: none; }

.app-notice--neutral {
  border-color: rgba(174, 184, 199, 0.22);
  border-left-color: #8f9bad;
  background: rgba(143, 155, 173, 0.09);
  color: #c5ccd6;
}

.app-notice--success {
  border-color: rgba(105, 188, 126, 0.28);
  border-left-color: #69bc7e;
  background: rgba(65, 145, 85, 0.11);
  color: #b9dfc2;
}

.app-notice--info {
  border-color: rgba(111, 153, 218, 0.3);
  border-left-color: #6f99da;
  background: rgba(64, 103, 165, 0.11);
  color: #bfd1ee;
}

.app-notice--warning {
  border-color: rgba(208, 170, 91, 0.3);
  border-left-color: #caa65e;
  background: rgba(166, 125, 48, 0.12);
  color: #e1cca0;
}

.app-notice--error {
  border-color: rgba(214, 107, 117, 0.3);
  border-left-color: #d66b75;
  background: rgba(162, 62, 72, 0.12);
  color: #efbdc2;
}

/* Light surfaces need darker feedback text, not the dark theme's pastel text. */
html.qvis-theme-light .app-notice {
  color: #374151;
  background: #f1f5f9;
  border-color: #cbd5e1;
}
html.qvis-theme-light .app-notice--success {
  color: #236035; background: #edf8ef; border-color: #acd2b6; border-left-color: #39804d;
}
html.qvis-theme-light .app-notice--info {
  color: #28548a; background: #edf4fc; border-color: #b6cce8; border-left-color: #4777b1;
}
html.qvis-theme-light .app-notice--warning {
  color: #795414; background: #fff8e6; border-color: #e5cf97; border-left-color: #af801d;
}
html.qvis-theme-light .app-notice--error {
  color: #9b2937; background: #fff0f1; border-color: #e5b3ba; border-left-color: #be4656;
}

.app-notice--centered {
  align-self: center;
  max-width: calc(100% - 24px);
  margin: 7px auto 2px;
}

.app-notice--no-shrink {
  flex: 0 0 auto;
}

.well-header-message-slot .app-notice {
  margin: 0;
}

.well-header-card .well-header-message-slot .app-notice {
  padding: 3px 8px;
  line-height: 1.2;
}

.app-notice.is-dismissing {
  opacity: 0;
}

.app-notice-stack {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 12000;
  display: flex;
  width: min(360px, calc(100vw - 28px));
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}

.app-notice-stack .app-notice {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 34px 8px 10px;
  background-color: #202733;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.app-notice__dismiss {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: 600 16px/1 sans-serif;
  opacity: 0.62;
}

.app-notice__dismiss:hover,
.app-notice__dismiss:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  opacity: 1;
  outline: none;
}

@media (max-width: 600px) {
  .app-notice-stack {
    top: 48px;
    right: 8px;
    width: calc(100vw - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-notice {
    transition: none;
  }
}
