/* ปุ่มเข้าสู่ระบบ / เมนูผู้ใช้ / กล่องล็อกอิน ใช้ร่วมทุกหน้า (ค่าสีมีค่าสำรองในตัว) */
.auth-slot { display: inline-flex; align-items: center; flex: none; min-width: 0; }
.hdr-r { display: flex; align-items: center; gap: 8px; flex: none; }
.auth-btn, .user-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1.5px solid #3E7A56; background: #3E7A56; color: #fff;
  font: 700 14px/1 "Sarabun", "Noto Sans Thai", system-ui, sans-serif; white-space: nowrap; cursor: pointer;
}
.auth-btn.compact { width: 40px; padding: 0; }
.auth-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.auth-btn.compact .lbl { display: none; }
@media (min-width: 900px) { .auth-btn.compact { width: auto; padding: 0 14px; } .auth-btn.compact .lbl { display: inline; } }
.user-btn { padding: 0 12px 0 3px; background: #fff; color: #2F6B4C; border-color: #CFDDD2; max-width: 190px; }
.user-btn .u-name { overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.av { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #6FB58A; color: #fff; font: 600 16px/1 "Kanit", "Sarabun", system-ui, sans-serif; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 559px) { .user-btn { padding: 0 3px; } .user-btn .u-name { display: none; } }
.auth-menu { position: fixed; z-index: 3000; min-width: 170px; padding: 6px; border-radius: 14px; background: #fff; color: #3F5A4A; border: 1px solid #CFDDD2; box-shadow: 0 8px 26px rgba(23, 34, 29, .3); }
.auth-menu .who { padding: 6px 10px 8px; font-size: 13px; color: #57725F; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-menu button { display: block; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: 600 15px/1 "Sarabun", system-ui, sans-serif; text-align: left; cursor: pointer; }
.auth-menu button:hover, .auth-menu button:focus-visible { background: #EEF6EE; }

dialog.login-dlg {
  box-sizing: border-box; width: min(360px, calc(100vw - 24px)); max-width: none; margin: auto; padding: 18px 18px 16px;
  border: 0; border-radius: 20px; background: #FBF7EE; color: #3F5A4A;
  font: 400 15px/1.5 "Sarabun", "Noto Sans Thai", system-ui, sans-serif; box-shadow: 0 12px 40px rgba(23, 34, 29, .4);
}
dialog.login-dlg::backdrop { background: rgba(23, 34, 29, .55); }
dialog.login-dlg.nm { position: fixed; inset: 64px 12px auto auto; margin: 0; box-shadow: 0 8px 30px rgba(23, 34, 29, .35); z-index: 2500; }
.login-dlg .l-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.login-dlg h2 { margin: 0; font: 600 19px/1.3 "Kanit", "Sarabun", system-ui, sans-serif; color: #2F6B4C; }
.login-dlg .l-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
.login-dlg .l-b { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; margin-bottom: 10px; border-radius: 12px; font: 700 16px/1.2 "Sarabun", system-ui, sans-serif; cursor: pointer; }
.login-dlg .l-g { background: #fff; color: #3F5A4A; border: 1.5px solid #CFDDD2; }
.login-dlg .l-g:hover { background: #EEF6EE; }
.login-dlg .l-g svg { width: 20px; height: 20px; flex: none; }
.login-dlg .l-line { background: #E7ECE8; color: #7A8C80; border: 1.5px solid #E7ECE8; cursor: default; }
.login-dlg .l-note { margin: 8px 0 0; font-size: 13px; color: #57725F; }
.login-dlg .l-note a { color: #2F6B4C; text-decoration: underline; }
.toast.auth-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 14px; background: #17221D; color: #fff; font-weight: 700; font-size: 15px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, transform .2s, visibility .2s; z-index: 3500; text-align: center; }
.toast.auth-toast.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.foot-links { margin: 0; padding: 12px 0 20px; text-align: center; font-size: 13px; color: #57725F; }
.foot-links a { color: inherit; text-decoration: underline; }
