.ph-stack {
  position: fixed; inset: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) auto auto;
  display: grid; gap: 10px; width: min(440px, calc(100vw - 28px)); max-width: none;
  margin: 0; padding: 4px; border: 0; background: transparent; overflow: visible;
  pointer-events: none; z-index: 2147483647; box-sizing: border-box;
}
.ph-stack::backdrop { background: transparent; pointer-events: none }
.ph-toast, dialog.ph-dialog {
  box-sizing: border-box; color: #f5f8ff; border: 1px solid #d8ac4b; border-radius: 17px;
  background: radial-gradient(ellipse at 94% 110%, #71552b -18%, transparent 32%),
    linear-gradient(148deg, #16395b 0%, #071d37 43%, #06142b 78%, #102e50);
  box-shadow: 0 9px 26px #020a1a55, inset 0 1px 0 #ffe4a455;
}
.ph-toast { --accent: #8eedaf; position: relative; padding: 12px 18px 17px; overflow: hidden; pointer-events: auto; animation: ph-enter .18s ease-out }
.ph-toast header, .ph-dialog header { display: flex; align-items: center; margin-bottom: 12px; border-bottom: 1px solid #5981a744; padding-bottom: 5px }
.ph-toast header::after { content: ''; margin: 0 32px 0 auto; width: 36%; height: 20px; background: #3675ae55; clip-path: polygon(0 96%,28% 38%,46% 64%,73% 7%,87% 28%,100% 0,87% 39%,73% 18%,46% 76%,28% 50%,0 100%) }
.ph-brand { width: 112px; height: 38px; object-fit: contain }
.ph-close { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; background: transparent; color: #fff; font: 26px/1 sans-serif; cursor: pointer }
.ph-message { display: grid; grid-template-columns: 36px 1fr; gap: 13px; align-items: center; text-align: left; overflow-wrap: anywhere }
.ph-message > div { padding-left: 13px; border-left: 1px solid #c4a45e }
.ph-message strong { font-size: 1.03rem; line-height: 1.25 }
.ph-message p, .ph-dialog p { margin: 4px 0 0; color: #dee8f5; font-size: .9rem; line-height: 1.45 }
.ph-icon { display: grid; place-items: center; color: var(--accent); width: 36px; height: 36px; border: 2px solid; box-sizing: border-box; border-radius: 50%; background: #163d39; font: bold 24px/1 sans-serif }
.ph-error { --accent: #ffb9bc }.ph-error .ph-icon { background: #882a39 }
.ph-info { --accent: #b9e1ff }.ph-info .ph-icon { background: #19588b }
.ph-warning { --accent: #ffda73 }.ph-warning strong { color: var(--accent) }
.ph-warning .ph-icon { border: 0; border-radius: 0; background: #ffcc62; color: #362300; clip-path: polygon(50% 0,100% 95%,0 95%); padding-top: 6px }
.ph-progress { position: absolute; inset: auto 0 0; height: 2px; background: linear-gradient(90deg,#977029,#ffe299 75%,#d99027); transform-origin: left; animation: ph-time linear forwards }
.ph-leave { animation: ph-exit .16s ease-in forwards }
dialog.ph-dialog { width: min(410px,calc(100vw - 28px)); padding: 21px; overflow-wrap: anywhere }
.ph-dialog::backdrop { background: #020c1dc9 }.ph-dialog form { display: block }.ph-dialog input { margin-top: 14px; width: 100% }.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 20px }.ph-actions .ph-danger { background: #9f2539; color: white; border-color: #e78d99 }
.ph-stack button:focus-visible,.ph-dialog :focus-visible { outline: 2px solid #ffe096; outline-offset: 1px }
@keyframes ph-enter { from { opacity: 0; transform: translateY(-6px) } }
@keyframes ph-exit { to { opacity: 0; transform: translateY(-4px) } }
@keyframes ph-time { to { transform: scaleX(0) } }
@media(prefers-reduced-motion:reduce){ .ph-toast,.ph-progress { animation: none }.ph-progress { display:none } }
