/* Notices (static/notices.js): toasts floating at the bottom of the landing page
   and the Studio, and the panel that covers the Studio during maintenance.
   Plain CSS with its own tokens, so it reads the same on both pages. */

:root {
  --notice-ink: #16151c;
  --notice-muted: #3b3945;
  --notice-card: #fff;
  --notice-rule: #e6e3ec;
  --notice-info: #f4f4f8;
  --notice-tint: #efedf8;
  --notice-warn: #fdf3dc;
  --notice-warn-edge: #b7791f;
  --notice-veil: rgba(21, 19, 31, .55);
  --notice-accent: #4a3f8a;
  --notice-hover: rgba(0, 0, 0, .07);
}
/* Dark, as static/theme.js and the system decide; the two blocks hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --notice-ink: #f2f1f6;
    --notice-muted: #cecad8;
    --notice-card: #1d1c25;
    --notice-rule: #2e2c38;
    --notice-info: #1d1c25;
    --notice-tint: #2a2640;
    --notice-warn: #2e230d;
    --notice-warn-edge: #f2b45c;
    --notice-veil: rgba(0, 0, 0, .6);
    --notice-accent: #c0b8f6;
    --notice-hover: rgba(255, 255, 255, .08);
  }
}
:root[data-theme="dark"] {
  --notice-ink: #f2f1f6;
  --notice-muted: #cecad8;
  --notice-card: #1d1c25;
  --notice-rule: #2e2c38;
  --notice-info: #1d1c25;
  --notice-tint: #2a2640;
  --notice-warn: #2e230d;
  --notice-warn-edge: #f2b45c;
  --notice-veil: rgba(0, 0, 0, .6);
  --notice-accent: #c0b8f6;
  --notice-hover: rgba(255, 255, 255, .08);
}

.mela-notices {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 60;
  display: grid;
  justify-items: end;
  gap: .5rem;
  pointer-events: none;
  font: 400 .9rem/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--notice-ink);
}

.mela-notice {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .75rem;
  row-gap: .25rem;
  width: min(30rem, 100%);
  padding: .7rem 2.75rem .7rem 1rem;
  border: 1px solid var(--notice-rule);
  border-left: 4px solid var(--notice-rule);
  border-radius: 12px;
  background: var(--notice-info);
  box-shadow: 0 2px 6px rgba(22, 21, 28, .06), 0 18px 48px rgba(22, 21, 28, .14);
  pointer-events: auto;
  animation: mela-notice-in .25s ease-out;
}
@keyframes mela-notice-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .mela-notice { animation: none; } }
.mela-notice--maintenance { background: var(--notice-warn); border-left-color: var(--notice-warn-edge); }

.mela-notice__text { flex: 1 1 14rem; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mela-notice__note { color: var(--notice-muted); font-style: italic; }
.mela-notice__link {
  flex: none;
  color: var(--notice-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mela-notice__close {
  position: absolute;
  top: .45rem;
  right: .45rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--notice-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.mela-notice__close:hover, .mela-notice__close:focus-visible { background: var(--notice-hover); }

/* The Studio's "this tab is out of date" and "what's new": full lines, not one row. */
.mela-notice--update {
  display: block;
  background: var(--notice-card);
  border-left-color: var(--notice-accent);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.mela-notice__title { margin: 0; font-weight: 600; }
.mela-notice__news { margin: .4rem 0 0; padding: 0; list-style: none; }
.mela-notice__news li { margin-top: .25rem; overflow-wrap: anywhere; }
.mela-notice__kind { color: var(--notice-accent); font-weight: 600; }
.mela-notice--update .mela-notice__text { margin-top: .5rem; color: var(--notice-muted); }
.mela-notice__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.mela-notice__action {
  min-height: 2.25rem;
  padding: .3rem .9rem;
  border: 1px solid var(--notice-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--notice-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.mela-notice__action:hover, .mela-notice__action:focus-visible { background: var(--notice-hover); }
.mela-notice__action--main { border-color: var(--notice-accent); color: var(--notice-accent); }

.mela-closed {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--notice-veil);
  backdrop-filter: blur(3px);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.mela-closed__card {
  width: min(28rem, 100%);
  padding: 1.75rem 1.5rem;
  border-radius: 16px;
  background: var(--notice-card);
  color: var(--notice-ink);
  text-align: center;
  box-shadow: 0 30px 90px rgba(28, 24, 60, .22);
}
.mela-closed__mark { font-size: 2rem; line-height: 1; color: var(--notice-warn-edge); }
.mela-closed__title { margin: .75rem 0 .5rem; font-size: 1.25rem; font-weight: 600; }
.mela-closed__text, .mela-closed__note { margin: 0 0 .75rem; color: var(--notice-muted); line-height: 1.5; }
.mela-closed__note { font-style: italic; }
.mela-closed__retry {
  margin-top: .5rem;
  padding: .55rem 1.1rem;
  border: 1px solid var(--notice-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--notice-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.mela-closed__retry:hover, .mela-closed__retry:focus-visible { background: var(--notice-tint); }
