/* ATP Coaching V30.21.42 — mobile sizing consistency across public and dashboard forms.
   UI-only: no changes to permissions, booking, payment, or data flow. */
@media (max-width: 767px) {
  html,body {max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%;}
  #public-shell, #dashboard-shell {width:100%;max-width:100%;overflow-x:clip;}
  #public-shell .container {max-width:100%;min-width:0;padding-left:16px;padding-right:16px;}
  #public-shell .simple-section-header h2 {font-size:clamp(28px,8vw,39px);line-height:1.05;overflow-wrap:anywhere;}
  #public-shell .simple-section {padding-top:36px;padding-bottom:39px;}
  #public-shell .atp-coach-feature-head {display:flex;align-items:flex-end;flex-wrap:nowrap;gap:8px;}
  #public-shell .atp-coach-feature-head>div:first-child {flex:1;min-width:0;}
  #public-shell .atp-coach-feature-head h2 {font-size:clamp(24px,7vw,34px);}
  #public-shell .atp-coach-tools {flex:0 0 auto;gap:6px;}
  #public-shell .atp-coach-tools button {width:38px;min-width:38px;min-height:38px;padding:7px;font-size:15px;}

  /* Root cause #1: flex:1 1 240px becomes 240px *height* in column direction. */
  #public-shell .atp-coach-filter {display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin:0 0 15px;align-items:stretch;}
  #public-shell .atp-coach-filter input,
  #public-shell .atp-coach-filter select {display:block;flex:none!important;flex-basis:auto!important;width:100%;height:46px;min-height:46px;max-height:46px;min-width:0;margin:0;padding:10px 12px;font-size:16px;line-height:1.3;box-sizing:border-box;}
  #public-shell .atp-coach-filter input::placeholder {font-size:14px;}
  #public-shell .atp-coach-directory {padding:22px 0 40px;}
  #public-shell .atp-coach-directory-head {gap:12px;margin-bottom:18px;}
  #public-shell .atp-coach-directory-head h2 {font-size:clamp(27px,7.5vw,35px);}
  #public-shell .atp-coach-directory-head p {font-size:12px;line-height:1.55;}
  #public-shell .atp-coach-close {min-height:40px;padding:9px 12px;font-size:12px;}
  #public-shell .atp-coach-count {margin-bottom:12px;}

  /* Root cause #2: buttons flex:1 1 160px inherit a 160px height when stacked. */
  #public-shell .featured-coach-actions {display:grid!important;grid-template-columns:minmax(0,1fr);gap:9px;margin-top:10px;padding-top:0;align-items:stretch;}
  #public-shell .featured-coach-actions button,
  #public-shell .featured-coach-actions .simple-coach-register,
  #public-shell .featured-coach-actions .simple-coach-btn {display:inline-flex;flex:none!important;flex-basis:auto!important;align-items:center;justify-content:center;width:100%;height:43px;min-height:43px;max-height:46px;margin:0;padding:9px 12px;font-size:13px;line-height:1.3;white-space:normal;box-sizing:border-box;}
  #public-shell .atp-coach-carousel {gap:12px;scroll-padding-left:0;}
  #public-shell .atp-coach-carousel>.simple-coach-card {flex:0 0 min(82vw,350px)!important;width:min(82vw,350px);min-width:0;display:flex!important;flex-direction:column;}
  #public-shell .atp-coach-carousel .simple-coach-photo {height:180px!important;flex:0 0 180px;}
  #public-shell .atp-coach-carousel .simple-coach-details {padding:14px!important;display:flex!important;flex-direction:column;min-height:0;gap:5px;}
  #public-shell .simple-coach-card .simple-coach-details h3 {font-size:16px;line-height:1.3;margin:2px 0 3px;}
  #public-shell .simple-coach-card .simple-coach-details p {font-size:12px;line-height:1.55;min-height:0!important;margin:0 0 6px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;}
  #public-shell .simple-coach-card .simple-tags {margin-bottom:6px;}
  #public-shell .atp-coach-directory-list {grid-template-columns:minmax(0,1fr);gap:14px;}
  #public-shell .atp-coach-directory-list .simple-coach-card {display:flex!important;flex-direction:column;min-width:0;}
  #public-shell .atp-coach-directory-list .simple-coach-photo {height:180px!important;min-height:0;}
  #public-shell .atp-coach-directory-list .simple-coach-details {padding:14px;}
  #public-shell .atp-coach-see-all {font-size:12px;min-height:40px;}
  #public-shell .atp-coach-honor {font-size:11px;line-height:1.4;padding:6px 9px;}

  /* Public navigation and modal proportions. */
  #public-shell .top-inner {min-width:0;gap:9px;}
  #public-shell .top .atp-reference-brand {flex:0 1 auto;min-width:0;max-width:150px;}
  #public-shell .top .atp-reference-brand img {width:clamp(112px,30vw,142px);max-width:100%;height:auto;}
  #public-shell .nav-actions {min-width:0;flex:0 1 auto;gap:6px;}
  #public-shell .nav-actions .btn {font-size:12px;line-height:1.2;min-height:40px;padding:9px 10px;white-space:nowrap;}
  #public-shell .hamburger {flex:0 0 auto;min-width:39px;min-height:40px;padding:5px;}
  #featured-card-dialog.featured-dialog {box-sizing:border-box;width:calc(100vw - 22px);max-width:560px;max-height:calc(100dvh - 24px);padding:16px;overflow-x:hidden;overflow-y:auto;}
  #featured-card-dialog .featured-dialog-image {max-height:200px;}
  #featured-card-dialog-title {font-size:clamp(23px,7vw,30px);line-height:1.22;}
  #featured-card-dialog .atp-coach-profile-facts {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  #featured-card-dialog .atp-coach-profile-facts>div {padding:10px;min-width:0;overflow-wrap:anywhere;}
  #featured-card-dialog .atp-coach-profile-actions {bottom:-16px;padding:10px 0 2px;gap:8px;}
  #featured-card-dialog .atp-coach-profile-actions button {flex:1 1 0;min-width:0;min-height:43px;padding:10px 8px;font-size:12px;}
  #public-shell dialog:not(#featured-card-dialog) {max-width:calc(100vw - 22px);max-height:calc(100dvh - 24px);overflow-y:auto;}
  #public-shell .simple-price-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  #public-shell .simple-price-card {min-width:0;min-height:0;padding:15px 11px;gap:10px;}
  #public-shell .simple-price-num {font-size:clamp(30px,8vw,42px);white-space:normal;overflow-wrap:anywhere;}
  #public-shell .simple-price-cta {min-height:41px;font-size:11px;padding:9px 7px;}

  /* Dashboard fields/buttons: readable, touch-sized, no sideways overflow. */
  #dashboard-shell main {min-width:0;padding:16px 12px 66px;}
  #dashboard-shell .dash-wrap {padding-left:12px;padding-right:12px;}
  #dashboard-shell .dash-panel-head {padding:12px 13px;gap:8px;flex-wrap:wrap;}
  #dashboard-shell .dash-form-grid, #dashboard-shell .cms-grid {min-width:0;}
  #dashboard-shell .dash-form-grid>* , #dashboard-shell .cms-grid>* {min-width:0;max-width:100%;}
  #dashboard-shell input:not([type="checkbox"]):not([type="radio"]),
  #dashboard-shell select, #dashboard-shell textarea,
  #dash-editor input:not([type="checkbox"]),#dash-editor select,#dash-editor textarea {box-sizing:border-box;max-width:100%;font-size:16px;}
  #dashboard-shell input:not([type="checkbox"]):not([type="radio"]),#dashboard-shell select {min-height:43px;}
  #dashboard-shell .dash-btn {min-height:40px;max-width:100%;font-size:12px;padding:9px 11px;white-space:normal;}
  #dashboard-shell .dash-toolbar {gap:8px;}
  #dashboard-shell .dash-actions {gap:8px;}
  #dashboard-shell .dash-actions .dash-btn {flex:0 1 auto;}
  #dashboard-shell .dash-stats {grid-template-columns:repeat(2,minmax(0,1fr));}
  #dashboard-shell .dash-stats.dash-stats-overview {grid-template-columns:repeat(2,minmax(0,1fr));}
  #dashboard-shell .dash-booking {grid-template-columns:72px minmax(0,1fr);gap:10px;padding:13px;}
  #dashboard-shell .dash-booktime strong {font-size:25px;}
  #dashboard-shell .dash-book-form {grid-template-columns:minmax(0,1fr);padding:13px;}
  #dashboard-shell .dash-book-form button {grid-column:auto;}
  #dashboard-shell .dash-package-grid {grid-template-columns:minmax(0,1fr);padding:12px;}
  #dashboard-shell .dash-table-wrap {overflow-x:auto;-webkit-overflow-scrolling:touch;}
  #dashboard-shell .dash-table {min-width:640px;}
  #dash-editor {box-sizing:border-box;width:calc(100vw - 18px);max-height:calc(100dvh - 20px);padding:15px;}
  #dash-editor .dash-edit-fields {grid-template-columns:minmax(0,1fr);}
  #dash-editor .dash-edit-actions {gap:8px;}
  #dashboard-shell .atp-profile-advanced {padding:10px;}
  #dashboard-shell .atp-honor-compact-panel .atp-honor-picker {display:grid;grid-template-columns:minmax(0,1fr);gap:6px;}
  #dashboard-shell .atp-honor-compact-panel .atp-honor-picker .cms-field {width:100%;min-width:0;max-width:100%;}
  #dashboard-shell .atp-honor-compact-panel .atp-honor-picker small {padding:0;}
  #dashboard-shell .atp-daily-agenda {padding:13px;}
  #dashboard-shell .atp-daily-item {gap:8px;padding:11px;}
}
@media (max-width: 390px) {
  #public-shell .container {padding-left:12px;padding-right:12px;}
  #public-shell .top .atp-reference-brand img {width:108px;}
  #public-shell .nav-actions .btn {font-size:11px;padding:8px;}
  #public-shell .atp-coach-carousel>.simple-coach-card {flex-basis:87vw!important;width:87vw;}
  #public-shell .simple-price-grid {grid-template-columns:1fr;}
  #featured-card-dialog .atp-coach-profile-facts {grid-template-columns:1fr;}
  #dashboard-shell .dash-stats {gap:7px;}
  #dashboard-shell .dash-metric {padding:11px;}
}
