/* ============================================================
   RR STABILITY LAYER (additive) — เสริมความเสถียร/การเข้าถึง/มือถือ
   เขียนเป็นชั้นต่อท้ายธีมเดิม ไม่แก้กฎเดิม ลบทั้งบล็อกนี้ได้ทันทีหากต้องการย้อนกลับ
============================================================ */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-wrap:break-word}
img,video,canvas{max-width:100%}
[hidden]{display:none!important}

/* แตะครั้งเดียวทำงานทันที ไม่หน่วง/ไม่ซูมโดยไม่ตั้งใจเมื่อกดรัว */
button,[role="button"],a,select,summary,label[for],
input[type="checkbox"],input[type="radio"],input[type="file"]{touch-action:manipulation}

/* โฟกัสคีย์บอร์ดเห็นชัด (ความเฉพาะเจาะจงเป็น 0 — กฎเดิมของหน้าชนะเสมอ) */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:3px solid rgba(37,99,235,.55);outline-offset:2px}

/* กัน iOS ซูมหน้าอัตโนมัติเมื่อแตะช่องกรอก (ต้อง ≥16px) — เฉพาะอุปกรณ์สัมผัส */
@media (pointer:coarse){
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  select,textarea,.form-control,.form-select{font-size:16px!important}
}

/* ข้อความยาว/ชื่อไฟล์/อีเมลไม่ดันตารางและการ์ดให้ล้นจอ */
.table td,.table th,.modal-body,.card-body{overflow-wrap:break-word}
.table-responsive,.overflow-auto,.overflow-x-auto{-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.modal,.modal-dialog-scrollable .modal-body{overscroll-behavior:contain}
button:disabled,.btn:disabled,.btn.disabled{cursor:not-allowed}

/* ผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* แบนเนอร์แจ้งเมื่อขาดอินเทอร์เน็ต (สร้างโดยสคริปต์ api) */
#rrConnBanner{position:fixed;top:0;left:0;right:0;z-index:2000;background:#dc2626;color:#fff;text-align:center;
  font:600 .9rem/1.4 'Kanit',system-ui,sans-serif;padding:.45rem .75rem;box-shadow:0 4px 14px rgba(0,0,0,.22)}
img[loading="lazy"]{background-color:#eef0f4}
