/* ระบบแจ้งเตือน: toast / banner / ป้ายสถานะ (ไฟล์นี้แยกจาก app.css) */
.nt-stack { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column-reverse; gap: 10px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.nt { position: relative; overflow: hidden; pointer-events: auto; display: grid; grid-template-columns: 28px 1fr 24px; gap: 10px; align-items: start; padding: 12px 12px 14px 14px; border-radius: 14px; background: rgba(255,255,255,.96); backdrop-filter: blur(14px); box-shadow: 0 10px 34px rgba(20,25,40,.2), 0 0 0 1px rgba(20,25,40,.07); transform: translateY(14px) scale(.97); opacity: 0; transition: transform .26s cubic-bezier(.2,.9,.3,1.15), opacity .22s; }
.nt.in { transform: none; opacity: 1; }
.nt.out { transform: translateX(24px); opacity: 0; transition: transform .22s ease-in, opacity .2s; }
.nt-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; background: #f26b1d; margin-top: 1px; }
.nt-success .nt-ico { background: #1f7a4d; } .nt-error .nt-ico { background: #d93025; } .nt-warn .nt-ico { background: #e08a00; font-size: 11px; } .nt-info .nt-ico { background: #f26b1d; }
.nt-body b { display: block; font-size: 15px; line-height: 1.35; color: #1d1d1f; }
.nt-body p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: #4a4a52; overflow-wrap: anywhere; }
.nt-act { margin-top: 8px; border: 0; background: #eef4fd; color: #0057b8; font-weight: 600; font-size: 13.5px; padding: 4px 12px; border-radius: 99px; cursor: pointer; }
.nt-act:hover { background: #dbe9fb; }
.nt-x { border: 0; background: transparent; color: #8a8a93; cursor: pointer; font-size: 13px; border-radius: 6px; width: 24px; height: 24px; line-height: 1; }
.nt-x:hover { background: #ececf0; color: #333; }
.nt-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: .5; transform-origin: left; animation: nt-bar linear forwards; color: #f26b1d; }
.nt-success .nt-bar { color: #1f7a4d; } .nt-error .nt-bar { color: #d93025; } .nt-warn .nt-bar { color: #e08a00; }
.nt.paused .nt-bar { animation-play-state: paused; }
@keyframes nt-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* แบนเนอร์ค้างใต้แถบบน */
.nt-banners { position: sticky; top: 52px; z-index: 19; }
.nt-banner { display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-size: 14.5px; border-bottom: 1px solid rgba(0,0,0,.08); }
.nt-banner .nt-ico { width: 22px; height: 22px; font-size: 12px; flex: none; }
.nt-bmsg { flex: 1; min-width: 0; }
.nt-b-error { background: #fdecea; color: #7a1710; } .nt-b-error .nt-ico { background: #d93025; }
.nt-b-warn { background: #fff4de; color: #6b4300; } .nt-b-warn .nt-ico { background: #e08a00; }
.nt-b-info { background: #e8f1fd; color: #0b3d7a; } .nt-b-info .nt-ico { background: #f26b1d; }
.nt-bact { border: 0; background: rgba(0,0,0,.08); color: inherit; font-weight: 600; padding: 4px 14px; border-radius: 99px; cursor: pointer; font-size: 13.5px; }
.nt-bact:hover { background: rgba(0,0,0,.14); }

/* popup (modal.js) เพิ่มเติม */
dialog.modal .modal-card { animation: nt-pop .26s cubic-bezier(.2,.9,.3,1.2); }
@keyframes nt-pop { from { transform: translateY(12px) scale(.96); opacity: 0; } }

@media (max-width: 560px) { .nt-stack { right: 10px; left: 10px; width: auto; bottom: 10px; } }
@media (prefers-reduced-motion: reduce) { .nt, .nt.in, .nt.out, dialog.modal .modal-card { transition: none; animation: none; } .nt-bar { animation: none; } }
@media print { .nt-stack, .nt-banners { display: none; } }

/* ==========================================================================
   มือถือ (portrait) — toast / แบนเนอร์ / แถบตัวอย่าง: โผล่ใต้แถบบน ไม่ทับปุ่มล่าง (ปุ่มย้อนกลับ/ถัดไป)
   ========================================================================== */
@media (max-width: 760px) {
  .nt-stack { top: calc(var(--tb-h, 56px) + 8px); bottom: auto; right: max(10px, env(safe-area-inset-right)); left: max(10px, env(safe-area-inset-left)); width: auto; flex-direction: column; z-index: 90; }
  .nt { transform: translateY(-14px) scale(.97); grid-template-columns: 28px minmax(0, 1fr) 40px; padding: 12px 6px 14px 14px; border-radius: 16px; }
  .nt.in { transform: none; }
  .nt.out { transform: translateY(-14px); }
  .nt-body b { font-size: 16px; }
  .nt-body p { font-size: 15px; line-height: 1.5; }
  .nt-act { min-height: 44px; padding: 0 16px; font-size: 14.5px; }
  .nt-x { width: 40px; height: 40px; font-size: 15px; margin-top: -6px; }
  /* แบนเนอร์ค้าง: ไม่ติดจอบนมือถือ (กันซ้อนกับแถบเมนูขั้นตอนที่ติดอยู่) */
  .nt-banners { position: static; }
  .nt-banner { flex-wrap: wrap; gap: 8px 10px; padding: 10px max(14px, env(safe-area-inset-left)) 10px max(14px, env(safe-area-inset-right)); font-size: 15px; }
  .nt-bmsg { flex: 1 1 14em; }
  .nt-bact { min-height: 44px; padding: 0 18px; font-size: 14.5px; }
}
