/* Shared toast styles (js/sk_toast.js). Loaded by the admin shell
   (base.html), the admin login shell (auth_base.html) and the customer
   portal (portal_base.html). Colours come from whichever token set the
   shell defines: admin tokens (dark + light), then portal --prt-* tokens,
   then fixed fallbacks. */
.sk-toast-stack {
    --sk-toast-bg: var(--bg-card, var(--prt-surface, #161b22));
    --sk-toast-solid: var(--surface, var(--prt-surface, #161b22));
    --sk-toast-text: var(--text, var(--prt-text, #e1e4e8));
    --sk-toast-muted: var(--text-muted, var(--prt-text-muted, #8b949e));
    --sk-toast-border: var(--border, var(--prt-border, #30363d));
    --sk-toast-success: var(--green, var(--prt-on, #22c55e));
    --sk-toast-error: var(--red, var(--prt-off, #ef4444));
    --sk-toast-warning: var(--yellow, var(--prt-warn, #f59e0b));
    --sk-toast-info: var(--primary, var(--prt-accent, #58a6ff));
}
#toast-container.sk-toast-stack {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    width: max-content;
    max-width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}
.sk-toast-stack .toast {
    --sk-toast-accent: var(--sk-toast-info);
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem 0.7rem 0.75rem;
    border: 1px solid var(--sk-toast-border);
    border-left: 4px solid var(--sk-toast-accent);
    border-radius: var(--radius, 10px);
    background: var(--sk-toast-solid);
    background: color-mix(in srgb, var(--sk-toast-accent) 12%, var(--sk-toast-solid));
    color: var(--sk-toast-text);
    font-size: 0.88rem;
    line-height: 1.4;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.sk-toast-stack .toast.toast-show { transform: translateX(0); opacity: 1; }
.sk-toast-stack .toast-success { --sk-toast-accent: var(--sk-toast-success); }
.sk-toast-stack .toast-error,
.sk-toast-stack .toast-danger { --sk-toast-accent: var(--sk-toast-error); }
.sk-toast-stack .toast-warning { --sk-toast-accent: var(--sk-toast-warning); }
.sk-toast-stack .toast-info { --sk-toast-accent: var(--sk-toast-info); }
.sk-toast-stack .toast::before {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.05rem;
    border-radius: 50%;
    background: var(--sk-toast-accent);
    color: var(--sk-toast-solid);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    content: "i";
}
.sk-toast-stack .toast-success::before { content: "\2713"; }
.sk-toast-stack .toast-error::before,
.sk-toast-stack .toast-danger::before { content: "!"; }
.sk-toast-stack .toast-warning::before { content: "!"; border-radius: 3px; }
.sk-toast-stack .toast-message {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}
.sk-toast-stack .toast-link {
    flex: 0 0 auto;
    color: var(--sk-toast-accent);
    font-weight: 600;
    text-decoration: underline;
}
.sk-toast-stack .toast-clickable { cursor: pointer; }
.sk-toast-stack .toast-close {
    flex: 0 0 auto;
    background: none;
    border: none;
    color: var(--sk-toast-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.1rem;
    line-height: 1;
}
.sk-toast-stack .toast-close:hover,
.sk-toast-stack .toast-close:focus-visible { color: var(--sk-toast-text); }
@media (max-width: 640px) {
    #toast-container.sk-toast-stack { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; width: auto; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .sk-toast-stack .toast { transition: none; }
}

/* Flash banners: categories without a style in the shell stylesheets.
   "danger" is a legacy alias of "error" used by a few routes. */
.flash.flash-danger {
    background: rgba(255, 59, 48, 0.12);
    border: 1px solid var(--red, #ef4444);
    color: var(--red, #ef4444);
}
.sk-auth-flash.flash-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
    color: #f59e0b;
}

/* Light theme role migration: keep page surfaces and status ink paired. */
html[data-theme="light"] .sk-auth-flash.flash-warning { color: var(--badge-warn-fg, #78350f); }
