/* Popover joins the top layer; modal dialogs cannot dim or cover it. */
#toast,.mobile #toast{position:fixed;inset:auto 12px max(24px,env(safe-area-inset-bottom)) 12px;margin:0 auto;width:fit-content;max-width:min(380px,calc(100vw - 24px));max-height:min(180px,40dvh);padding:12px 10px 12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);box-shadow:0 8px 32px #0004;z-index:2147483647;font-size:13px;line-height:1.6;overflow:visible;gap:10px;align-items:flex-start}
#toast[hidden]{display:none}
#toast.notice-visible{display:flex}
#toast.notice-entering{animation:notice-appear .18s ease-out both}
#toast.notice-leaving{opacity:0;transform:translateY(6px);transition:opacity .16s ease,transform .16s ease}
#toast::backdrop{background:transparent;pointer-events:none}
#toast .notice-icon{flex:0 0 19px;width:19px;height:19px;margin-top:3px;border:1px solid currentColor;border-radius:50%;display:grid;place-items:center;font-size:12px;line-height:1}
#toast .notice-message{min-width:0;max-height:130px;overflow:auto;overflow-wrap:anywhere;white-space:pre-wrap;padding:2px 0}
#toast .notice-close{flex:0 0 30px;width:30px;min-width:30px;height:30px;min-height:30px;padding:0;border:0;background:transparent;border-radius:6px;color:var(--muted);font-size:21px;line-height:1}
#toast .notice-close:hover{background:var(--hover);color:var(--text)}
#toast.notice-error .notice-icon{color:var(--warn)}
#toast.notice-progress .notice-icon{border-color:var(--line);border-top-color:var(--text);animation:notice-spin .8s linear infinite}
body:has(dialog[open]) #toast{bottom:max(94px,calc(env(safe-area-inset-bottom) + 82px))}
.mobile #toast{bottom:max(84px,calc(env(safe-area-inset-bottom) + 72px))}
@keyframes notice-spin{to{transform:rotate(360deg)}}
@keyframes notice-appear{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){#toast.notice-entering{animation:none}#toast.notice-leaving{transition:none}#toast.notice-progress .notice-icon{animation:none;border-style:dotted}}
