/* Phase 43-3: mobile-only polish for LINE / attendance workflows.
   Desktop layout is intentionally untouched. */
@media (max-width: 768px){
  html{font-size:16px;}
  body.rotary-admin-page{background:#f4f7fb;}

  /* Admin shell: compact mobile header + single-column content */
  .rotary-admin-page .admin-layout{display:block;min-height:100vh;}
  .rotary-admin-page .rotary-admin-sidebar{
    position:sticky!important;top:0;z-index:60;width:100%!important;height:auto!important;
    max-height:72vh;overflow-y:auto;padding:14px 16px!important;border-radius:0 0 18px 18px;
    box-shadow:0 10px 24px rgba(15,23,42,.16);
  }
  .rotary-admin-page .rotary-sidebar-head{margin-bottom:10px;}
  .rotary-sidebar-head h2{font-size:20px;}
  .rotary-sidebar-toggle{width:44px;height:44px;min-width:44px;}
  .rotary-admin-page .sidebar-user{margin:8px 0 10px;padding:10px 12px;}
  .rotary-menu-group{padding:6px 0;}
  .rotary-menu-group-title{padding:8px 0;font-size:15px;}
  .rotary-menu-group-list a,.rotary-admin-page .rotary-admin-sidebar a{
    font-size:16px;padding:12px 12px;margin:4px 0;border-radius:12px;
  }
  body.rotary-sidebar-mini .rotary-admin-sidebar{padding:12px 14px!important;}
  body.rotary-sidebar-mini .rotary-sidebar-head h2{display:block;}
  body.rotary-sidebar-mini .sidebar-user,body.rotary-sidebar-mini .rotary-sidebar-menu{display:none;}

  .rotary-admin-page .rotary-admin-main{margin-left:0!important;width:100%!important;padding:14px!important;box-sizing:border-box;}
  .rotary-admin-top-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px;}
  .rotary-admin-top-actions .btn{display:block;text-align:center;padding:11px 10px;}
  .rotary-admin-top-actions .danger{grid-column:auto;}

  .page-title,h1{font-size:26px;line-height:1.25;margin:14px 0;}
  h2{font-size:21px;line-height:1.3;}
  .card{border-radius:16px;padding:16px!important;margin-top:14px;}
  .notice,.flash{border-radius:14px;padding:12px 14px;line-height:1.55;}
  .actions{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;}
  .actions form{display:block!important;}
  .actions .btn,.actions button{width:100%;text-align:center;box-sizing:border-box;}

  /* Forms */
  .form-grid,.filter-bar,.public-media-filter,.member-filters{grid-template-columns:1fr!important;gap:12px!important;}
  input,select,textarea{font-size:16px!important;max-width:100%;box-sizing:border-box;}
  textarea{min-height:120px;}
  .btn,button.btn,a.btn{min-height:42px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;gap:6px;}
  .btn.small{min-height:38px;padding:8px 10px;}

  /* Tables: preserve data while avoiding broken mobile layout */
  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:16px;background:#fff;}
  .table-wrap table{min-width:860px;}
  .table-wrap th,.table-wrap td{font-size:14px;white-space:nowrap;}

  /* Attendance pages */
  .stat-grid{grid-template-columns:1fr!important;gap:12px!important;}
  .member-name{font-size:28px!important;}
  #attendanceCopyText{min-height:260px!important;font-size:15px!important;line-height:1.65!important;}
  .qr-img{width:88px!important;height:88px!important;}
  .qr-img.large{width:180px!important;height:180px!important;display:block;margin:8px auto;}
  .compact-input{max-width:100%!important;width:100%!important;font-size:13px!important;}

  /* Check-in confirmation: optimized for staff mobile scanning */
  body .card[style*="max-width:680px"]{max-width:none!important;margin:10px 0!important;}
  body .card[style*="max-width:680px"] p{font-size:16px;line-height:1.6;}
  body .card[style*="max-width:680px"] form{display:grid;grid-template-columns:1fr;gap:10px;}
  body .card[style*="max-width:680px"] form .btn{width:100%;}

  /* Phase 43 standalone push center */
  .phase43-wrap{padding:14px!important;}
  .phase43-title{display:block!important;}
  .phase43-title h1{font-size:26px!important;}
  .phase43-grid,.phase43-form-grid{grid-template-columns:1fr!important;gap:12px!important;}
  .phase43-card{border-radius:16px!important;padding:15px!important;}
  .phase43-table{min-width:720px;}
  .phase43-card:has(.phase43-table){overflow-x:auto;}
  .phase43-btn{width:100%;min-height:44px;}
}

@media (max-width: 480px){
  .rotary-admin-top-actions{grid-template-columns:1fr;}
  .page-title,h1{font-size:24px;}
  .table-wrap table{min-width:760px;}
  .qr-img.large{width:160px!important;height:160px!important;}
}
