/* ============================================================================
 * PUI — platform UI dialogs. Self-contained; loaded globally from the topbar.
 * Brand: saffron (#d97706-ish). No dependency on module CSS variables.
 * ========================================================================== */

/* ---- Toasts -------------------------------------------------------------- */
.pui-toasts {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
    z-index: 4000; display: flex; flex-direction: column; gap: 8px;
    width: max-content; max-width: min(92vw, 420px); pointer-events: none;
}
.pui-toast {
    pointer-events: auto;
    background: #1f2937; color: #fff; border-radius: 10px;
    padding: 11px 16px; font-size: .9rem; line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.pui-toast.is-in { opacity: 1; transform: translateY(0); }
.pui-toast--success { background: #15803d; }
.pui-toast--error   { background: #b91c1c; }
.pui-toast--info    { background: #1f2937; }

/* ---- Modal (confirm / prompt) ------------------------------------------- */
.pui-modal {
    position: fixed; inset: 0; z-index: 4100;
    display: grid; place-items: center; padding: 16px;
    background: rgba(17, 24, 39, .55);
    opacity: 0; transition: opacity .18s;
}
.pui-modal.is-in { opacity: 1; }
.pui-modal__card {
    width: min(440px, 96vw); max-height: 92vh; overflow: auto;
    background: #fff; color: #1f2937; border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .3); padding: 22px;
    transform: translateY(8px) scale(.98); transition: transform .18s;
}
.pui-modal.is-in .pui-modal__card { transform: none; }
.pui-modal__title { margin: 0 0 8px; font-size: 1.1rem; font-weight: 700; }
.pui-modal__msg { margin: 0 0 4px; font-size: .94rem; line-height: 1.45; color: #374151; }
.pui-modal__input {
    width: 100%; box-sizing: border-box; margin-top: 14px;
    border: 1px solid #d1d5db; border-radius: 9px; padding: 10px 12px; font-size: .95rem;
}
.pui-modal__input:focus { outline: 2px solid #f59e0b; outline-offset: 1px; border-color: #f59e0b; }
.pui-modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ---- Buttons (self-contained) ------------------------------------------- */
.pui-btn {
    border: 1px solid transparent; border-radius: 999px; cursor: pointer;
    padding: 9px 20px; font-size: .9rem; font-weight: 600; line-height: 1;
    transition: background .12s, border-color .12s, color .12s;
}
.pui-btn--primary { background: #b45309; color: #fff; }
.pui-btn--primary:hover { background: #92400e; }
.pui-btn--danger { background: #b91c1c; color: #fff; }
.pui-btn--danger:hover { background: #991b1b; }
.pui-btn--ghost { background: transparent; color: #374151; border-color: #d1d5db; }
.pui-btn--ghost:hover { background: #f3f4f6; }

@media (max-width: 480px) {
    .pui-modal__actions { justify-content: stretch; }
    .pui-modal__actions .pui-btn { flex: 1 1 auto; }
}

/* ---- Info popover ((i) hint that replaces subtitle narration) ------------ */
.pui-info {
    -webkit-appearance: none; appearance: none;
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.25em; height: 1.25em; padding: 0; margin-left: .38em;
    border: 1.5px solid currentColor; border-radius: 50%;
    background: transparent; color: inherit; opacity: .5;
    font-size: .66em; font-weight: 700; font-style: normal; line-height: 1;
    font-family: Georgia, "Times New Roman", serif;
    cursor: pointer; vertical-align: middle; flex: none;
    transition: opacity .12s, background .12s, color .12s, border-color .12s;
}
.pui-info::before { content: "i"; }
.pui-info:hover,
.pui-info[aria-expanded="true"] { opacity: 1; background: #b45309; color: #fff; border-color: #b45309; }
.pui-info:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; opacity: 1; }

.pui-tip {
    position: fixed; z-index: 4200; max-width: 320px;
    background: #1f2937; color: #f9fafb;
    border-radius: 10px; padding: 10px 13px;
    font-size: .84rem; line-height: 1.45; font-weight: 400; text-align: left;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    opacity: 0; transform: translateY(-4px); pointer-events: none;
    transition: opacity .14s, transform .14s;
}
.pui-tip.pui-tip--above { transform: translateY(4px); }
.pui-tip.is-in { opacity: 1; transform: none; pointer-events: auto; }
.pui-tip__title { display: block; margin-bottom: 3px; font-weight: 700; font-size: .86rem; color: #fff; }
.pui-tip__body { display: block; color: #e5e7eb; }

@media (prefers-reduced-motion: reduce) {
    .pui-tip { transition: opacity .14s; transform: none; }
}
