/* Phone layout only. Desktop and tablet keep their existing styles. */
.phone-shortcuts,.phone-table-hint{display:none}
@media(max-width:600px){
  html{scroll-padding-top:90px}
  body{overflow-wrap:break-word}
  input,select,textarea{font-size:16px;min-width:0}
  button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
  .button,.button.compact,.mini-button,.danger-button,.delete-link,.link-button{min-height:44px}
  .button{padding:10px 14px;line-height:1.35;text-align:center;white-space:normal}
  .mini-button,.delete-link{padding:10px 12px}
  .login-view{min-height:100svh;gap:24px;padding:24px 16px max(24px,env(safe-area-inset-bottom));align-content:center}
  .league-banner{width:210px;max-height:55px;margin-bottom:16px}
  .login-brand h1{font-size:28px;line-height:1.05;margin:12px 0;letter-spacing:-.03em}
  .login-brand .eyebrow{font-size:10px;letter-spacing:.07em}
  .login-copy,.role-chips{display:none}
  .login-card{padding:24px 20px;border-radius:20px;min-width:0}
  .login-card h2{font-size:26px;margin-bottom:22px}
  .login-card .form-note{font-size:12px;margin-top:16px}
  .app-view{padding:12px 12px max(28px,env(safe-area-inset-bottom))}
  .topbar{padding:16px;gap:14px;border-radius:18px}
  .topbar-brand{gap:12px;width:100%;min-width:0;align-items:center}
  .topbar-brand>div{min-width:0}
  .app-logo{width:48px;height:48px;flex-shrink:0}
  .topbar h1{font-size:32px}
  .topbar .eyebrow{font-size:9px;letter-spacing:.06em}
  .topbar p:last-child{margin-top:5px;font-size:12px;line-height:1.4}
  .account-box{min-width:0;padding:10px 12px;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;border-radius:12px}
  .account-box strong{font-size:14px;overflow-wrap:anywhere;align-self:end}
  .account-box span{grid-row:2;font-size:11px}
  .account-box .link-button{grid-column:2;grid-row:1/3;margin:0;font-size:12px}
  .quick-actions{position:sticky;top:0;z-index:5;display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;margin:12px -12px 20px;padding:10px 12px;background:var(--page);border-bottom:1px solid var(--line);scrollbar-width:thin}
  .quick-actions .button{flex:0 0 auto;min-height:46px;font-size:12px;padding:10px 12px;white-space:nowrap}
  .page-heading{display:block;margin-bottom:16px}
  .page-heading h2{font-size:25px}
  .page-heading p:last-child{font-size:13px;line-height:1.5}
  .secure-badge{display:none}
  .card,.ctc-home-summary{padding:16px;border-radius:16px;min-width:0}
  .ctc-home-heading{display:block}
  .ctc-home-heading h3,.card h3{font-size:21px}
  .ctc-home-heading p:last-child{font-size:13px;line-height:1.45}
  .ctc-brevet-distribution{grid-template-columns:1fr;gap:8px}
  .ctc-brevet-card{padding:13px}
  .home-excel-actions{margin-top:14px}
  .brevet-panel-intro{gap:12px}
  .brevet-panel-intro p:not(.eyebrow){font-size:13px;line-height:1.5}
  .panel-actions{display:grid;grid-template-columns:1fr;width:100%;gap:8px}
  .phone-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:18px 0}
  .phone-shortcuts a{display:flex;min-height:46px;align-items:center;justify-content:center;padding:10px 8px;border:1px solid #c3d8ec;border-radius:10px;color:var(--navy);background:#edf6ff;font-size:13px;font-weight:800;text-decoration:none}
  [id^='formation-']{scroll-margin-top:85px}
  .panel-section{margin-top:22px;padding-top:20px;min-width:0}
  .section-heading{display:block}
  .section-heading h4{font-size:19px}
  .section-heading .button,.attendance-opening .button{width:100%}
  .section-heading .count-chip{display:inline-block;margin-top:10px}
  .uf-grid{margin:16px 0;gap:12px}
  .uf-card{padding:14px;border-radius:14px}
  .uf-card h3{font-size:22px}
  .uf-activity h4{font-size:17px}
  .uf-activity>.button,.uf-activity form>.button{width:100%}
  .uf-activity label:has(input[type='checkbox']){display:flex;align-items:center;min-height:44px;gap:10px}
  .uf-activity input[type='checkbox']{flex:0 0 22px;min-height:22px;margin:0}
  .uf-activity summary{min-height:44px;padding:10px 0}
  .learning-path>p:not(.eyebrow){font-size:13px;line-height:1.6}
  .profile-summary{padding:14px;gap:14px}
  .profile-name{min-width:0;width:100%}
  .profile-name>div{min-width:0;overflow-wrap:anywhere}
  .profile-facts,.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .session-card,.attendance-card{padding:13px;grid-template-columns:minmax(0,1fr)}
  .session-actions{align-items:stretch}
  .attendance-periods{grid-template-columns:1fr}
  .attendance-period{display:grid;grid-template-columns:1fr auto;gap:10px}
  .attendance-period .button,.attendance-period small{grid-column:1/-1}
  .attendance-period .button{width:100%}
  .attendance-opening{display:grid;grid-template-columns:1fr}
  .document-card{grid-template-columns:minmax(0,1fr);padding:12px}
  .document-link strong{white-space:normal;overflow-wrap:anywhere;font-size:14px}
  .document-link{min-height:44px}
  .document-actions{gap:6px}
  .document-review{margin-left:0;flex-wrap:wrap}
  .management-row,.notification-row,.message-card{grid-template-columns:minmax(0,1fr);padding:13px;overflow-wrap:anywhere}
  .row-actions,.recipient-tools,.profile-actions{flex-wrap:wrap}
  .stats{gap:8px}
  .stat{padding:12px}
  .stat strong{font-size:25px}
  .workspace-grid,.form-grid,.recipient-grid,.brevet-choice-grid,.password-row,.signature-upload-row{grid-template-columns:minmax(0,1fr)}
  .full-row{grid-column:1/-1}
  .form-grid label,.dialog-form label{line-height:1.5}
  .brevet-choice,.recipient-choice{min-height:48px}
  .brevet-choice input,.recipient-choice input,.check-line input{flex-shrink:0}
  .inline-select{grid-template-columns:minmax(0,1fr)}
  .table-scroll{min-width:0;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .phone-table-hint{display:block;margin:0;padding:10px 13px;font-size:12px;color:var(--muted);background:#f6faff}
  .presence-table .presence-name{min-width:125px;max-width:140px;padding:10px 8px}
  .presence-name .name-button{max-width:124px;min-height:44px;overflow-wrap:anywhere}
  .presence-name small{max-width:124px;font-size:10px}
  .attendance-table,.attendance-table tbody,.attendance-table tr,.attendance-table td{display:block;min-width:0;width:100%}
  .attendance-table thead{display:none}
  .attendance-table tr{padding:12px;border-bottom:1px solid var(--line)}
  .attendance-table td{display:grid;grid-template-columns:90px minmax(0,1fr);gap:8px;padding:8px 0;border:0!important;font-size:13px;overflow-wrap:anywhere}
  .attendance-table td::before{content:attr(data-label);color:var(--muted);font-size:11px;font-weight:800;align-self:center}
  .attendance-table td:first-child{color:var(--navy);font-size:15px}
  .attendance-table .status-select{min-width:0;min-height:44px;width:100%}
  dialog,.wide-dialog{width:calc(100% - 16px);max-width:none;max-height:calc(100dvh - 24px);border-radius:18px}
  .dialog-form,.wide-dialog .dialog-form,.policy-dialog .dialog-form{padding:24px 18px max(20px,env(safe-area-inset-bottom));max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
  .dialog-form h2{padding-right:34px;font-size:23px}
  .dialog-close{top:8px;right:8px;width:44px;height:44px;border-radius:50%;background:#f1f5fa;z-index:1}
  .policy-text{padding:13px;font-size:14px}
  .signature-preview-wrap{flex-wrap:wrap}
  .toast{right:12px;bottom:max(12px,env(safe-area-inset-bottom));max-width:calc(100% - 24px);font-size:13px}
}
