/* Toaster: the guide-wide toast component rendered by javascripts/toaster.js,
   styled after the Qualytics app's toast. A neutral card in the top-right
   corner whose status color (--toast-tone) lands on the icon chip, the eyebrow
   and the progress line. The theme's own bottom-right dialog is hidden once
   the script is listening. */
.q-toasts-ready .md-dialog {
  display: none;
}

.q-toasts {
  position: fixed;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.q-toast {
  --toast-tone: var(--q-lighter);
  position: relative;
  box-sizing: border-box;
  width: min(560px, calc(100vw - 32px));
  padding: 12px 12px 12px 14px;
  overflow: hidden;
  border: 1px solid var(--q-shadow);
  border-radius: 12px;
  background-color: var(--q-surface);
  color: var(--q-normal);
  box-shadow:
    0 8px 28px color-mix(in srgb, var(--q-black) 14%, transparent),
    0 1px 3px color-mix(in srgb, var(--q-black) 8%, transparent);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: auto;
  transition: transform 1s, opacity 1s;
}

[data-md-color-scheme="slate"] .q-toast {
  box-shadow:
    0 8px 28px color-mix(in srgb, var(--q-black) 50%, transparent),
    0 1px 3px color-mix(in srgb, var(--q-black) 40%, transparent);
}

.q-toast--positive {
  --toast-tone: var(--q-positive);
}

.q-toast--entering,
.q-toast--leaving {
  opacity: 0;
  transform: translateY(-50px);
}

.q-toast__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 28px;
}

.q-toast__icon {
  display: flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--toast-tone);
  background-color: color-mix(in srgb, var(--toast-tone) 14%, transparent);
}

.q-toast__icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.q-toast__heading {
  flex: 1;
  min-width: 0;
}

.q-toast__kind {
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--toast-tone);
}

.q-toast__title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.q-toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--q-lighter);
  cursor: pointer;
}

.q-toast__close:hover,
.q-toast__close:focus-visible {
  background-color: color-mix(in srgb, var(--q-normal) 8%, transparent);
}

.q-toast__close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.q-toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-color: var(--toast-tone);
  transform-origin: 0 50%;
  animation: q-toast-progress linear both;
}

.q-toast:focus-within .q-toast__progress {
  animation-play-state: paused;
}

@keyframes q-toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

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