/* One notification surface shared by the public library and Builder. */
.notification-container {
    position: fixed;
    inset: 18px 18px auto auto;
    z-index: 3000;
    width: min(440px, calc(100vw - 36px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: start;
    gap: 9px;
    padding: 12px 10px 12px 12px;
    border: 1px solid var(--notification-border, #dbe3ef);
    border-left: 4px solid var(--notification-accent, #2563eb);
    border-radius: 9px;
    color: var(--notification-text, #172033);
    background: var(--notification-bg, #fff);
    box-shadow: 0 8px 26px rgb(15 23 42 / 18%);
    pointer-events: auto;
    animation: notification-in .18s ease-out;
}

.notification-success { --notification-accent: #15803d; --notification-soft: #f0fdf4; }
.notification-info { --notification-accent: #2563eb; --notification-soft: #eff6ff; }
.notification-warning { --notification-accent: #b45309; --notification-soft: #fffbeb; }
.notification-error { --notification-accent: #b91c1c; --notification-soft: #fef2f2; }
.notification-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--notification-accent);
    background: var(--notification-soft);
    font-weight: 800;
}
.notification-body { min-width: 0; line-height: 1.55; }
.notification-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.notification-detail { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9em; opacity: .82; }
.notification-body details { margin-top: 4px; font-size: .9em; }
.notification-body summary { cursor: pointer; color: var(--notification-accent); }
.notification-close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    color: inherit;
    background: transparent;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}
.notification-close:hover, .notification-close:focus-visible { background: var(--notification-soft); }
.notification-action {
    margin-top: 8px;
    padding: 5px 9px;
    border: 1px solid var(--notification-accent);
    border-radius: 5px;
    color: var(--notification-accent);
    background: transparent;
    cursor: pointer;
}
.notification-removing { animation: notification-out .18s ease-in forwards; }
@keyframes notification-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes notification-out { to { opacity: 0; transform: translateY(-5px); } }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --notification-text: #e5e7eb;
        --notification-bg: #1f2937;
        --notification-border: #475569;
    }
}
:root[data-theme="dark"] {
    --notification-text: #e5e7eb;
    --notification-bg: #1f2937;
    --notification-border: #475569;
}
@media (max-width: 600px) {
    .notification-container { inset: 10px 12px auto; width: auto; }
    .notification { grid-template-columns: 26px minmax(0, 1fr) 28px; }
}
@media (prefers-reduced-motion: reduce) {
    .notification, .notification-removing { animation: none; }
}
