/* Short messages at the top centre of the screen (ui/toaster.js): a white
   card with a coloured mark for the tone, the message, a × and a thin line
   along the bottom showing the time left. Newest on top. */
.rl-toaster {
  position: fixed;
  top: max(14px, calc(env(safe-area-inset-top) + 10px));
  left: 50%;
  z-index: 2147483000;
  width: min(460px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}

/* Under "This page may be out of date" when both are showing. */
body:has(.stale-workspace-notice.is-visible) .rl-toaster {
  top: max(96px, calc(env(safe-area-inset-top) + 92px));
}

.rl-toaster-list {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rl-toast {
  --rl-toast-tone: #1f6b52;
  --rl-toast-soft: #e6f2ec;
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 11px;
  width: fit-content;
  min-width: min(280px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 9px 9px 9px 10px;
  overflow: hidden;
  border: 1px solid rgba(22, 32, 28, 0.09);
  border-radius: 16px;
  color: var(--color-ink, #16201c);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow:
    0 22px 48px -22px rgba(22, 32, 28, 0.42),
    0 3px 10px -4px rgba(22, 32, 28, 0.12);
  font-family: var(--font-sans, system-ui, sans-serif);
  pointer-events: auto;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}

.rl-toast[data-tone="info"] {
  --rl-toast-tone: #3d5d86;
  --rl-toast-soft: #e9f0f8;
}

.rl-toast[data-tone="warning"] {
  --rl-toast-tone: #94590b;
  --rl-toast-soft: #fdf1da;
}

.rl-toast[data-tone="error"] {
  --rl-toast-tone: #b3263b;
  --rl-toast-soft: #fcebee;
}

/* Leaving: out of the flow where it stands while it fades. */
.rl-toast.is-leaving {
  position: absolute;
  left: 0;
  right: 0;
  margin-inline: auto;
  pointer-events: none;
}

.rl-toast-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--rl-toast-tone);
  box-shadow: 0 0 0 4px var(--rl-toast-soft);
}

.rl-toast-icon svg,
.rl-toast-close svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rl-toast-icon svg {
  stroke-width: 2.8;
}

.rl-toast-message {
  min-width: 0;
  margin: 0;
  padding-block: 4px;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.38;
  letter-spacing: -0.006em;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.rl-toast-close {
  display: grid;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  place-items: center;
  align-self: center;
  border: 0;
  border-radius: 999px;
  color: var(--color-muted, #5f6e68);
  background: transparent;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.rl-toast-close svg {
  stroke-width: 2.2;
}

.rl-toast-close:hover {
  color: var(--color-ink, #16201c);
  background: rgba(22, 32, 28, 0.07);
}

.rl-toast-close:focus-visible {
  outline: 2px solid var(--rl-toast-tone);
  outline-offset: 1px;
}

.rl-toast-timer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--rl-toast-tone);
  opacity: 0.4;
  transform-origin: left center;
}

@media (max-width: 560px) {
  .rl-toaster {
    top: max(10px, calc(env(safe-area-inset-top) + 6px));
  }

  .rl-toast {
    width: 100%;
    min-width: 0;
  }
}
