/* R256 — UI Density Balance (TEST)
   Goal: reduce oversized visual spacing while improving overly-small operational text.
   Keep large work surfaces (appointment slots / OPD canvas) unchanged. */

/* ---------- Users & Permissions ---------- */
@media (min-width:1101px){
  #soahV2MembersR254 .u254-stats{gap:8px;padding:12px 16px 10px}
  #soahV2MembersR254 .u254-stat{min-height:66px;padding:9px 11px;border-radius:12px;gap:9px}
  #soahV2MembersR254 .u254-stat>span{width:34px;height:34px;border-radius:10px}
  #soahV2MembersR254 .u254-stat b{font-size:18px}
  #soahV2MembersR254 .u254-stat small{margin-top:3px;font-size:10.5px}
  #soahV2MembersR254 .u254-list{padding:7px 14px 14px}
  #soahV2MembersR254 .u254-user-card{min-height:72px;padding:9px 8px;gap:10px}
  #soahV2MembersR254 .u254-ident>div>span{font-size:10.5px}
  #soahV2MembersR254 .u254-last small{font-size:9.5px}
  #soahV2MembersR254 .u254-last b{font-size:10.5px}
  #soahV2MembersR254 .u254-empty{padding:24px 16px}
  #soahV2MembersR254 .u254-role-card-body p{font-size:10.5px}
  #soahV2MembersR254 .u254-role-metrics span{font-size:10px}
  #u254Editor .u254-pgroup>summary,
  #u254RoleModal .u254-pgroup>summary{min-height:50px;padding:8px 10px}
  #u254Editor .u254-pgroup summary small,
  #u254RoleModal .u254-pgroup summary small{font-size:9.5px}
  #u254Editor .u254-pitem,
  #u254RoleModal .u254-pitem{min-height:56px;padding:8px 10px}
  #u254Editor .u254-pitem strong,
  #u254RoleModal .u254-pitem strong{font-size:11px}
  #u254Editor .u254-pitem small,
  #u254RoleModal .u254-pitem small{font-size:10px;line-height:1.4}
  #u254Editor .u254-pitem em,
  #u254RoleModal .u254-pitem em{font-size:9px}
  #u254Editor .u254-review{margin-top:10px;padding:10px}
  #u254Editor .u254-review-title{margin-bottom:8px}
  #u254Editor .u254-review-title small{font-size:9.5px}
  #u254Editor .u254-review-grid small{font-size:9.5px}
  #u254Editor .u254-review-grid b{font-size:10.5px}
}

/* ---------- Patient Registry ---------- */
@media (min-width:901px){
  .prv2-toolbar{gap:12px;padding:14px 2px 12px}
  .prv2-search-label{padding:11px 14px 6px}
  .prv2-search-label small{font-size:10px}
  .prv2-search-wrap{padding:3px 14px 8px}
  .prv2-search-input{height:44px}
  .prv2-empty,.prv2-loading{padding:24px 18px}
  .prv2-drawer{top:24px;width:min(1020px,calc(100vw - 56px));height:calc(100dvh - 48px);border-radius:18px}
  .prv2-drawer-head{padding:13px 18px 12px}
  .prv2-drawer-head p{font-size:10px}
  .prv2-drawer-body{padding:16px 18px 24px}
  .prv3-hero{grid-template-columns:104px minmax(0,1fr);gap:16px;padding:14px 16px;border-radius:16px}
  .prv3-photo{width:104px;height:104px;border-radius:15px}
  .prv3-photo small{font-size:10px}
  .prv3-kicker{font-size:10px}
  .prv3-identity h2{font-size:22px}
  .prv3-identity>p{font-size:11px}
  .prv3-status{padding:4px 7px;font-size:9.5px}
  .prv3-summary{margin-top:10px}
  .prv2-summary-box{padding:8px 9px}
  .prv2-summary-box small,.prv3-finance-overview small{font-size:9.5px}
  .prv2-field{padding:8px 10px}
  .prv2-field small{font-size:9.5px}
  .prv2-field strong{font-size:11px}
  .prv3-section{margin-top:10px;border-radius:13px}
  .prv3-section-title{padding:9px 11px}
  .prv3-section-title strong{font-size:11.5px}
  .prv3-section-title small{font-size:9.5px}
  .prv3-section-pad{padding:10px 11px}
  .prv3-subhead{padding:8px 11px 6px;font-size:10px}
  .prv3-record{padding:9px 11px}
  .prv3-record-main small,.prv3-record-main p,.prv3-record-side span{font-size:9.5px}
  .prv3-record-main strong,.prv3-record-side strong{font-size:11px}
  .prv3-course-list{padding:10px 11px}
  .prv3-course-head small,.prv3-course-head p,.prv3-course-foot{font-size:9.5px}
  .prv3-course-head>span,.prv3-doc-ready,.prv3-opd-state{font-size:9.5px}
  .prv3-next-appointment small,.prv3-next-appointment p{font-size:9.5px}
  .prv2-event-date{font-size:9.5px}
  .prv2-event-date span{font-size:9px}
  .prv3-actions{margin-top:12px;padding-top:9px}
}

/* iPad registry: preserve touch size while improving legibility */
@media (min-width:621px) and (max-width:1100px){
  .prv2-search-label small,
  .prv2-summary-box small,
  .prv2-field small,
  .prv3-section-title small,
  .prv3-record-main small,
  .prv3-record-main p,
  .prv3-record-side span,
  .prv3-course-head small,
  .prv3-course-head p,
  .prv3-course-foot,
  .prv3-next-appointment small,
  .prv3-next-appointment p{font-size:10px}
  .prv3-status,.prv3-opd-state,.prv3-doc-ready{font-size:10px}
  .prv2-action{min-height:44px}
}

/* ---------- Appointment ---------- */
/* Card height is intentionally preserved: it carries name/HN/phone/channel/note. */
.appointment-card-v2 .appointment-card-v2-note-text{font-size:10px}
.appointment-card-v2-warning,
.appointment-card-reschedule-badge{font-size:9.5px}
.appointment-card-v2.has-warning .appointment-card-v2-warning{font-size:9.5px}
.appointment-card-phone-secondary,
.appointment-card-notification,
.appointment-card-new,
.appointment-duration-badge,
.appointment-board-closure-badge,
.appointment-closure-time-helper,
.appointment-closure-list-reason small{font-size:10px}
.appointment-card-delete{min-width:32px;min-height:30px;font-size:10px}
@media (max-width:1100px){
  .appointment-room-lane .appointment-card-name{font-size:10.5px}
  .appointment-room-lane .appointment-card-meta{font-size:9.5px}
  .appointment-card-v2 .appointment-card-v2-note-text{font-size:10.5px}
  .appointment-card-v2-warning,
  .appointment-card-reschedule-badge{font-size:10px}
  .appointment-card-delete{min-width:38px;min-height:36px}
}

/* ---------- Finance ---------- */
.finance-treatment-summary{padding:16px 18px}
.finance-treatment-action{padding:16px 18px 18px}
.finance-quick-pick-photo-fallback,
.finance-quick-pick-selected,
.finance-quick-pick-badge{font-size:9.5px}
.finance-quick-pick-hn,
.finance-treatment-required,
.finance-status-title,
.finance-status-pill,
.finance-status-value,
.finance-status-note,
.finance-comm-key,
.finance-comm-exception,
.finance-comm-warning,
.finance-comm-editor-note,
.finance-crm-next-tier,
.finance-crm-source-inline{font-size:10px}
.finance-comm-card .finance-status-pill{font-size:10px}
.finance-crm-info{width:18px;height:18px;font-size:10px}
@media(max-width:1100px){
  .finance-treatment-summary,.finance-treatment-action{padding:14px 16px}
  .finance-status-title,.finance-status-value,.finance-status-note,
  .finance-comm-key,.finance-comm-exception,.finance-comm-warning,
  .finance-comm-editor-note,.finance-crm-next-tier,.finance-crm-source-inline{font-size:10.5px}
}

/* ---------- Reports ---------- */
#reportV2Root .rv2-nav-shell{padding:16px 0}
#reportV2Root #rv2Content{margin-top:20px}
#reportV2Root .rv2-section{gap:14px}
#reportV2Root .rv2-kpi{min-height:96px;padding:11px 13px}
#reportV2Root .rv2-kpi-foot,
#reportV2Root .rv2-delta{font-size:10px}
#reportV2Root .rv2-empty,
#reportV2Root .rv2-loading{padding:20px}
#reportV2Root .rv2-error{padding:18px}
@media(max-width:700px){
  #reportV2Root .rv2-nav-shell{padding:13px 0}
  #reportV2Root .rv2-kpi{min-height:96px}
}

/* ---------- Dashboard ---------- */
.dw2-metric small{font-size:10px}
.dw2-metric em{font-size:10px}
.dw2-panel-head p{font-size:10px}
.dw2-person p{font-size:10px}
.dw2-badge{font-size:9.5px}
.dw2-alert strong{font-size:11px}
.dw2-alert span{font-size:10px}
.dw2-all-good strong{font-size:11px}
.dw2-all-good span{font-size:10px}
.dw2-mini-row strong{font-size:10.5px}
.dw2-mini-row small,.dw2-mini-row em{font-size:9.5px}
.dw2-health-item small{font-size:10px}
.dw2-health-item em{font-size:9.5px}
.dw2-followup-row strong{font-size:10.5px}
.dw2-followup-row small,.dw2-followup-row em{font-size:9.5px}

/* ---------- Registration ---------- */
@media(min-width:901px){
  #register-section.registration-workspace{padding:18px 22px}
}
.thai-id-reader-status,
.thai-id-auto-toggle,
.registration-patient-state-badge,
.registration-hn-box #hnStatus,
.registration-field-hint,
.registration-document-help,
.registration-appointment-lookup,
.registration-appointment-assist-message,
.registration-appointment-candidate-copy,
.registration-optional-data-badge,
.registration-followup-card span span,
#passportMrzStatus{font-size:10px}
.registration-appointment-candidate button{min-height:34px;font-size:10px}
@media(max-width:1100px){
  .thai-id-reader-status,
  .thai-id-auto-toggle,
  .registration-patient-state-badge,
  .registration-hn-box #hnStatus,
  .registration-field-hint,
  .registration-document-help,
  .registration-appointment-lookup,
  .registration-appointment-assist-message,
  .registration-appointment-candidate-copy,
  .registration-optional-data-badge,
  .registration-followup-card span span,
  #passportMrzStatus{font-size:10.5px}
  .registration-appointment-candidate button{min-height:40px}
}

/* ---------- Shared empty/loading states ---------- */
.appointment-board-state{min-height:190px;padding:22px}
.appointment-board-state-card{padding:18px}
.patient-timeline-empty{padding:18px 14px}

/* ---------- OPD Online: only non-work-surface states ---------- */
.dopd-loading-cover{padding:16px}
.dopd-loading-card{width:min(480px,92%);padding:20px 22px;border-radius:15px}
.dopd-course-empty,.dopd-course-loading,.dopd-course-error{padding:20px 16px}


/* R256 mobile readability follow-up */
@media (max-width:760px){
  #soahV2MembersR254 .u254-ident>div>span{font-size:10.5px}
  #soahV2MembersR254 .u254-role,
  #soahV2MembersR254 .u254-state>span{font-size:10.5px}
  #soahV2MembersR254 .u254-last small{font-size:10px}
  #soahV2MembersR254 .u254-last b{font-size:11px}
}
@media (max-width:620px){
  .prv2-search-label small,
  .prv2-summary-box small,
  .prv2-field small,
  .prv3-section-title small,
  .prv3-record-main small,
  .prv3-record-main p,
  .prv3-record-side span,
  .prv3-finance-overview small,
  .prv3-course-head small,
  .prv3-course-head p,
  .prv3-course-foot,
  .prv3-next-appointment small,
  .prv3-next-appointment p,
  .prv2-event-date{font-size:10px}
  .prv3-status,
  .prv3-opd-state,
  .prv3-doc-ready,
  .prv3-course-head>span{font-size:10px}
  .prv2-event-date span{font-size:9px}
}
@media (max-width:1100px){
  .prv2-drawer-close{width:44px;height:44px}
  .prv3-jumpbar button{min-height:44px;font-size:10px}
  .appointment-card-delete{overflow:visible}
  .appointment-card-delete::after{content:"";position:absolute;inset:-4px}
  .registration-appointment-candidate button{min-height:44px}
}
@media (max-width:700px){
  #reportV2Root .rv2-tab-btn{min-height:44px}
}


/* R256 iPad balance */
@media (min-width:761px) and (max-width:1100px){
  #soahV2MembersR254 .u254-stat{min-height:72px;padding:10px 12px}
  #soahV2MembersR254 .u254-ident>div>span{font-size:10.5px}
  #soahV2MembersR254 .u254-last small{font-size:10px}
  #soahV2MembersR254 .u254-last b{font-size:11px}
  .dw2-metric em,
  .dw2-mini-row small,
  .dw2-mini-row em,
  .dw2-health-item em,
  .dw2-followup-row small,
  .dw2-followup-row em{font-size:10px}
}
