/* Hanuman Feasibility — dialog.css · loud centred dialogs (admin + public calculator)
 * สงวนลิขสิทธิ์ · พัฒนาด้วย Woradon Phikun · https://www.hanumanconnect.com */
.hnfsb-dlg { border: 0; padding: 0; border-radius: 16px; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: #fff; color: #1B2A3A; box-shadow: 0 24px 60px rgba(1, 31, 56, .35); font-family: "HNFSB Sarabun", "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif; overflow: auto; }
.hnfsb-dlg[open] { animation: hnfsb-pop .18s ease-out; }
.hnfsb-dlg::backdrop { background: rgba(1, 31, 56, .55); backdrop-filter: blur(2px); }
.hnfsb-dlg__box { padding: 26px 24px 20px; text-align: center; border-top: 6px solid #012D53; }
.hnfsb-dlg.is-success .hnfsb-dlg__box { border-top-color: #047857; }
.hnfsb-dlg.is-error .hnfsb-dlg__box { border-top-color: #B42318; }
.hnfsb-dlg.is-warn .hnfsb-dlg__box { border-top-color: #B45309; }
.hnfsb-dlg__icon { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: #E7EEF5; color: #012D53; }
.hnfsb-dlg.is-success .hnfsb-dlg__icon { background: #E6F4EE; color: #047857; }
.hnfsb-dlg.is-error .hnfsb-dlg__icon { background: #FDECEA; color: #B42318; }
.hnfsb-dlg.is-warn .hnfsb-dlg__icon { background: #FFF4E0; color: #B45309; }
.hnfsb-dlg__icon.is-busy svg { animation: hnfsb-spin .9s linear infinite; }
.hnfsb-dlg__title { margin: 0 0 6px; font-size: 20px; font-weight: 700; line-height: 1.3; color: #1B2A3A; }
.hnfsb-dlg__msg { margin: 0; font-size: 15px; line-height: 1.6; color: #3E4C5B; white-space: pre-line; word-break: break-word; }
.hnfsb-dlg__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
/* Buttons carry :not(#hnfsb-none) = id-level specificity, so classic themes that paint every
 * <button> (Twenty Twenty-One uses selectors up to 0,3,1) cannot recolour them. */
.hnfsb-dlg__btn:not(#hnfsb-none) { flex: 1 1 120px; min-height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid #E3E9EF; background: #fff; color: #012D53; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.hnfsb-dlg__btn:not(#hnfsb-none):hover { background: #E7EEF5; }
.hnfsb-dlg__btn:not(#hnfsb-none).is-primary { background: #012D53; border-color: #012D53; color: #fff; }
.hnfsb-dlg__btn:not(#hnfsb-none).is-primary:hover { background: #0A4472; }
.hnfsb-dlg__btn:not(#hnfsb-none).is-danger { background: #B42318; border-color: #B42318; color: #fff; }
.hnfsb-dlg__btn:not(#hnfsb-none).is-danger:hover { background: #8F1C13; }
.hnfsb-dlg__btn:not(#hnfsb-none):focus-visible { outline: 3px solid rgba(4, 130, 109, .5); outline-offset: 2px; }
.hnfsb-dlg__steps { margin: 14px 0 0; padding: 12px 14px 12px 34px; text-align: left; font-size: 14px; line-height: 1.55; color: #3E4C5B; background: #F4F7FA; border-radius: 10px; }
.hnfsb-dlg__steps li + li { margin-top: 4px; }
@keyframes hnfsb-pop { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hnfsb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hnfsb-dlg[open], .hnfsb-dlg__icon.is-busy svg { animation: none; } }

/* 2.2.0 · board rule 19 — PDF preview lightbox (every page drawn by pdf.js; saved only on the green button) */
dialog.hnfsb-lb:not(#hnfsb-none) { position: fixed; inset: 0; margin: auto; padding: 0; border: 0; border-radius: 16px; width: min(980px, calc(100vw - 32px)); height: min(92vh, 1200px); max-width: none; max-height: none; display: flex; flex-direction: column; overflow: hidden; background: #E3E9EF; color: #1B2A3A; box-shadow: 0 24px 60px rgba(1, 45, 83, .35); font-family: "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif; z-index: 100000; }
dialog.hnfsb-lb:not([open]) { display: none; }
dialog.hnfsb-lb::backdrop { background: rgba(1, 25, 45, .62); }
.hnfsb-lb__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 18px; color: #fff; background: linear-gradient(120deg, #7E2622, #A23430 58%, #A33A37); flex: none; }
.hnfsb-lb__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hnfsb-lb__t b { font-size: 16px; line-height: 1.3; }
.hnfsb-lb__t small { font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hnfsb-lb__ib:not(#hnfsb-none) { width: 44px; height: 44px; flex: none; border: 1px solid rgba(255, 255, 255, .35); border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; padding: 0; margin: 0; }
.hnfsb-lb__ib:not(#hnfsb-none):hover, .hnfsb-lb__ib:not(#hnfsb-none):focus-visible { background: rgba(255, 255, 255, .25); outline: 2px solid #fff; outline-offset: 1px; }
.hnfsb-lb__body { flex: 1; min-height: 0; overflow: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.hnfsb-lb__pages { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.hnfsb-lb__page { display: block; max-width: none; background: #fff; box-shadow: 0 2px 10px rgba(1, 45, 83, .18); border-radius: 2px; }
.hnfsb-lb__note { margin: 24px auto; max-width: 520px; text-align: center; color: #5B6B7C; font-size: 15px; }
.hnfsb-lb__note.is-err { color: #B42318; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 10px; padding: 12px 14px; }
.hnfsb-lb__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; background: #fff; border-top: 1px solid #E3E9EF; flex: none; }
.hnfsb-lb__info { flex: 1; min-width: 120px; font-size: 13.5px; color: #5B6B7C; }
.hnfsb-lb__foot .hnfsb-dlg__btn:not(#hnfsb-none) { min-height: 44px; }
.hnfsb-lb__foot .hnfsb-dlg__btn.is-save:not(#hnfsb-none) { background: #04806B; border-color: #04806B; color: #fff; font-weight: 700; }
.hnfsb-lb__foot .hnfsb-dlg__btn.is-save:not(#hnfsb-none):hover { background: #036A59; }
@media (max-width: 600px) {
	dialog.hnfsb-lb:not(#hnfsb-none) { width: 100vw; height: 100dvh; border-radius: 0; }
	.hnfsb-lb__body { padding: 8px; }
	.hnfsb-lb__foot .hnfsb-dlg__btn.is-save:not(#hnfsb-none) { flex: 1 1 100%; order: 3; }
	.hnfsb-lb__info { flex: 1 1 auto; }
}
