/* Cookie consent — bottom-right toast + centered modal.
   Tracks data-theme via the same tokens as the design system; falls
   back to dark-mode literals so unauthenticated public pages render
   correctly even before the React shell hydrates the app. */

@keyframes mash-cookie-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes mash-cookie-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes mash-cookie-scale-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.mash-cookie-toast[hidden] { display: none !important; }
.mash-cookie-toast {
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: var(--bg-overlay, #151927);
    border: 1px solid var(--border-default, #232A3B);
    border-radius: var(--r-xl, 14px);
    box-shadow: var(--shadow-xl, 0 24px 48px rgba(0,0,0,0.6), 0 8px 16px rgba(0,0,0,0.4));
    padding: 16px 18px;
    z-index: 1000;
    font: 14px/1.5 var(--font-sans, "Inter Tight", system-ui, sans-serif);
    color: var(--text-primary, #E8EAF2);
    animation: mash-cookie-slide-up 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.mash-cookie-toast-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text-primary, #E8EAF2);
}
.mash-cookie-toast-body {
    color: var(--text-secondary, #A5ABBD);
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 14px;
}
.mash-cookie-toast-body a {
    color: var(--brand-400, #6B72F5);
    text-decoration: underline;
}
.mash-cookie-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}
.mash-cookie-btn {
    font: inherit;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--r-md, 7px);
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 120ms, border-color 120ms, color 120ms;
    line-height: 1.2;
}
.mash-cookie-btn-ghost {
    background: transparent;
    border-color: var(--border-default, #232A3B);
    color: var(--text-primary, #E8EAF2);
}
.mash-cookie-btn-ghost:hover {
    background: var(--bg-hover, #1E2432);
    border-color: var(--border-strong, #2D3547);
}
.mash-cookie-btn-primary {
    background: var(--brand-500, #4F46E5);
    color: #fff;
    border-color: var(--brand-500, #4F46E5);
}
.mash-cookie-btn-primary:hover {
    background: var(--brand-600, #4338CA);
    border-color: var(--brand-600, #4338CA);
}

/* `display: flex` is only applied when the element is NOT hidden,
   otherwise it overrides the UA `[hidden] { display: none }` rule
   and the modal shows on first paint. */
.mash-cookie-backdrop[hidden] { display: none !important; }
.mash-cookie-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: mash-cookie-fade-in 140ms ease-out;
}
[data-theme="light"] .mash-cookie-backdrop { background: rgba(15, 19, 32, 0.4); }
.mash-cookie-modal {
    width: 480px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    background: var(--bg-overlay, #151927);
    border: 1px solid var(--border-default, #232A3B);
    border-radius: var(--r-xl, 14px);
    box-shadow: var(--shadow-xl, 0 24px 48px rgba(0,0,0,0.6), 0 8px 16px rgba(0,0,0,0.4));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: mash-cookie-scale-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
    font: 14px/1.5 var(--font-sans, "Inter Tight", system-ui, sans-serif);
    color: var(--text-primary, #E8EAF2);
}
.mash-cookie-modal-hd {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-subtle, #1A1F2E);
}
.mash-cookie-modal-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.mash-cookie-modal-desc { font-size: 13px; color: var(--text-secondary, #A5ABBD); margin: 0; }
.mash-cookie-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.mash-cookie-modal-ft {
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle, #1A1F2E);
    background: var(--bg-inset, #0D0F16);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.mash-cookie-pref {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-md, 7px);
    border: 1px solid var(--border-subtle, #1A1F2E);
    background: var(--bg-raised, #10131B);
    cursor: pointer;
}
.mash-cookie-pref input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--brand-500, #4F46E5);
}
.mash-cookie-pref-text { display: flex; flex-direction: column; gap: 2px; }
.mash-cookie-pref-name { font-size: 13px; font-weight: 600; color: var(--text-primary, #E8EAF2); }
.mash-cookie-pref-hint { font-size: 12px; color: var(--text-secondary, #A5ABBD); line-height: 1.5; }
.mash-cookie-pref[aria-disabled="true"] { opacity: 0.7; cursor: not-allowed; }
