/* 61801: phone-only refinements. The approved desktop rules remain unchanged. */
@media (max-width:767px), (max-width:1023px) and (pointer:coarse) and (max-height:600px) {
  :root{--mobile-bottom-height:76px;--mobile-header-height:116px;--page-gutter:14px}
  html{scroll-padding-top:calc(var(--mobile-header-height) + 14px)}
  .app{width:100%;padding-inline:0;min-height:var(--app-height,100dvh)}
  .main-header{padding:calc(12px + env(safe-area-inset-top,0px)) max(14px,env(safe-area-inset-right,0px)) 12px max(14px,env(safe-area-inset-left,0px))}
  #header>.header-line:has(.header-tools>:nth-child(2))>div:first-child,#header>.header-line>div:first-child{padding-left:43px!important}
  #header>.header-line>div:first-child:before{width:32px;height:32px;border-radius:10px}
  .header-line{min-height:44px;gap:8px}
  #header .header-line h1{font-size:21px;line-height:1.3;letter-spacing:-.5px}
  #header .subtitle{font-size:10px;line-height:1.4;margin-top:3px}
  .header-tools{gap:7px}
  .icon-btn{width:42px;min-width:42px;height:44px;border-radius:13px}
  .search-wrap{margin-top:11px}
  .search{height:44px;min-height:44px;border-radius:13px}
  #main{padding:4px max(14px,env(safe-area-inset-right,0px)) calc(var(--mobile-bottom-height) + 22px) max(14px,env(safe-area-inset-left,0px))}
  .campus-hero{min-height:154px;padding:18px 20px;margin-bottom:12px;border-radius:20px}
  .hero-copy{max-width:100%}
  .hero-eyebrow{font-size:7px;letter-spacing:1.6px;gap:6px}
  .campus-hero h2{font-size:23px;line-height:1.35;margin:10px 0 5px;letter-spacing:-.6px}
  .campus-hero p{font-size:10px;line-height:1.6;letter-spacing:0}
  .hero-write{min-height:42px;padding:9px 12px;margin-top:10px;gap:19px;border-radius:10px;font-size:11px}
  .hero-art{right:-37px;width:190px;opacity:.28}
  .hero-art>b{font-size:118px;right:33px;top:6px}
  .hero-art>b>span{font-size:60px;right:-11px;top:10px}
  .hero-art>small{right:34px;bottom:15px;font-size:5px}
  .home-tools{gap:10px;margin-bottom:12px}
  .home-tool{min-height:65px;padding:11px 12px;gap:9px;border-radius:16px}
  .home-tool-icon{width:32px;height:32px;border-radius:11px}
  .home-tool b{font-size:12px;line-height:1.5}
  .home-tool small{display:block;font-size:10px;line-height:1.4;margin-top:2px}
  .chips{gap:7px;padding:0 0 4px;scroll-padding-inline:2px;overscroll-behavior-x:contain}
  .chip{min-height:40px;padding:8px 12px;font-size:11px;border-radius:13px}
  .section-title{margin:17px 0 11px;gap:9px;min-height:32px}
  .section-title h2{font-size:16px}
  .feed-mode-note{font-size:9px;padding:5px 7px;white-space:nowrap}
  .card,.panel{padding:16px;border-radius:19px;margin-bottom:12px}
  .post-head{gap:10px}
  .post-head .avatar{width:40px;height:40px;min-width:40px;min-height:40px;border-radius:13px}
  .post-head .user-meta b{font-size:14px;line-height:1.5}
  .user-meta small{font-size:10px;line-height:1.65;overflow-wrap:anywhere}
  .post-more{width:22px;min-width:22px;font-size:17px}
  .post-text{font-size:15px;line-height:1.8;margin:12px 0;word-break:normal}
  .feed-card .post-text{-webkit-line-clamp:6}
  .media-grid{gap:5px;margin:11px 0}
  .media-tile{border-radius:12px}
  .actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px;margin-top:11px;padding-top:7px}
  .actions button{min-width:0;min-height:44px;padding:5px 2px;gap:4px;font-size:10px;border-radius:9px;line-height:1.4}
  .actions .ui-icon{width:15px;height:15px}
  .feed-pagination{padding:12px 0 18px;gap:8px}
  .feed-pagination .btn{min-height:44px;min-width:128px;font-size:12px}
  .bottom{position:fixed;left:0;right:0;transform:none;bottom:0;width:100%;max-width:none;min-height:66px;height:auto;margin:0;padding:7px max(10px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));gap:3px;border:1px solid #e5e8ee;border-bottom:0;border-radius:20px 20px 0 0;background:#fffffff5;box-shadow:0 -5px 25px #24304508}
  .bottom button{min-height:50px;gap:4px;border-radius:13px}
  .bottom button>span{height:24px;display:grid;place-items:center}
  .bottom button svg{width:22px;height:22px}
  .bottom button small{font-size:10px;line-height:1.3;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .bottom .publish-nav>span{width:38px;height:31px;font-size:25px;border-radius:10px}
  .bottom .publish-nav{gap:2px}
  .site-registration-footer{padding-bottom:calc(var(--mobile-bottom-height) + 12px);font-size:10px}
  .mobile-keyboard-open .bottom,.mobile-keyboard-open .site-registration-footer{display:none!important}
  .mobile-keyboard-open #main{padding-bottom:24px}
  .mobile-keyboard-open .main-header{position:relative}
  .tabs{border-radius:14px;gap:4px;padding:4px}
  .tabs button{min-height:44px;padding:10px 8px;font-size:13px;border-radius:11px}
  .trade-tabs,.publish-page>.tabs{position:sticky;top:var(--mobile-header-height);z-index:9;background:#eef1f7}
  .form{gap:15px;min-width:0}
  .form label{font-size:12px;line-height:1.6;min-width:0}
  .input,.select,.textarea{font-size:16px!important;line-height:1.5;min-width:0;width:100%;min-height:48px;padding:11px 12px;border-radius:12px;box-sizing:border-box}
  input[type=date],input[type=time],input[type=datetime-local]{max-width:100%;min-width:0}
  .textarea{min-height:148px}
  .publish-page #postText{min-height:168px}
  .publish-page #postMediaPreview:empty,.publish-page #postFilePreview:empty,.publish-page #postTagPreview:empty{display:none}
  .publish-page .post-attachment-add{width:48px;height:48px;min-width:48px}
  .toggle-row{gap:14px;padding:13px;min-height:62px;align-items:center}
  .toggle-row>span{min-width:0;flex:1}
  .toggle-row small{display:block;font-size:11px;line-height:1.65;margin-top:3px}
  .toggle-row input{flex:0 0 auto}
  .btn,.more-link,.upload-button,.close{min-height:44px}
  .more-link{padding-inline:11px;font-size:11px}
  .btn{font-size:13px;padding:11px 14px;border-radius:12px}
  .detail-header{min-height:calc(62px + env(safe-area-inset-top,0px));padding:calc(9px + env(safe-area-inset-top,0px)) max(14px,env(safe-area-inset-right,0px)) 9px max(14px,env(safe-area-inset-left,0px));gap:10px}
  .detail-back,.detail-header>.icon-btn{width:44px;height:44px;min-height:44px}
  .detail-title{font-size:16px}
  .detail-body:not(.chat-detail){padding:14px max(14px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px))}
  .detail-body:not(.chat-detail)>*{max-width:100%;min-width:0}
  .detail-section,.detail-hero{padding:17px;border-radius:19px;margin-bottom:12px}
  .detail-actions{gap:9px;padding:12px 0 max(8px,env(safe-area-inset-bottom,0px));z-index:6;grid-template-columns:repeat(2,minmax(0,1fr))}
  .detail-actions .btn{min-width:0;min-height:46px;white-space:normal;line-height:1.5}
  .detail-actions.four{grid-template-columns:repeat(2,minmax(0,1fr))}
  .comment-compose{grid-template-columns:44px minmax(0,1fr) 76px;gap:7px;align-items:center}
  .comment-media-button{width:44px;height:48px;min-width:44px;min-height:48px}
  #commentInput{min-width:0;height:48px}
  #commentSendButton{min-width:0;width:76px;min-height:48px;padding:8px 6px;font-size:12px}
  .comment-item{gap:9px}
  .comment-body{min-width:0}
  .comment-tools{gap:6px;flex-wrap:wrap}
  .comment-tool-actions{margin-left:auto}
  .comment-tool-actions button{min-width:44px;min-height:44px}
  .profile{padding:18px 16px;border-radius:21px}
  .profile-id{gap:12px;align-items:center}
  .profile-id>div{min-width:0}
  .profile-id h2{font-size:20px;line-height:1.5}
  .profile .avatar.big{width:54px;height:54px;min-width:54px;min-height:54px;border-radius:18px;font-size:21px}
  .profile-personalized .profile-avatar-button .avatar{color:#35415b!important}
  .profile .login-account-button{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left;font-size:10px;line-height:1.6}
  .profile .stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:15px;padding-top:13px}
  .profile .stats b{font-size:20px;line-height:1.4}
  .profile .stats small{font-size:11px}
  .profile .profile-follow-stats{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:13px}
  .profile-main-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .preview-strip,.profile-strip{gap:10px;scroll-snap-type:x proximity;scroll-padding-inline:1px;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .preview-card,.profile-mini{scroll-snap-align:start;flex-shrink:0}
  .preview-card{flex-basis:calc((100% - 18px)/2.15);min-width:130px}
  .card.menu{padding:4px 15px}
  .menu button{min-height:54px;gap:12px;font-size:13px}
  .menu button>span:first-child{min-width:0}
  .menu button>span:last-child{font-size:11px;flex-shrink:0;max-width:48%;text-align:right;overflow-wrap:anywhere}
  .cp-entry{min-height:80px;padding:16px;border-radius:18px}
  .mobile-me-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:10px 6px;margin-bottom:14px}
  .mobile-me-shortcuts button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:64px;min-width:0;border:0;border-radius:12px;background:transparent;color:#5664a1;font-size:11px;line-height:1.4}
  .mobile-me-shortcuts button:hover{background:#f1f3ff}
  .mobile-me-shortcuts svg{width:23px;height:23px;flex-shrink:0}
  .cp-layout,.growth-layout{min-width:0}
  .cp-layout .org-actions{display:flex;flex-wrap:wrap;gap:9px}
  .cp-layout .org-actions>.btn{flex:1;min-width:110px}
  .cp-layout .cp-balance{font-size:43px}
  .cp-layout .cp-claim-value{font-size:44px;line-height:1.35}
  .cp-layout code{overflow-wrap:anywhere;word-break:break-word}
  .cp-cdk-qr svg{max-width:240px;width:100%;height:auto}
  .cp-cdk-card{align-items:stretch;flex-direction:column;gap:10px}
  .cp-cdk-card>.btn{width:100%}
  .cp-cdk-output{font-size:13px!important}
  .scanner-frame{min-height:0;aspect-ratio:1;max-height:46dvh;border-radius:17px}
  .scanner-frame video{min-height:0;height:100%;max-height:46dvh;object-fit:cover}
  .discover-ad-slide{padding:20px;min-height:210px}
  .discover-ad-title{font-size:23px;line-height:1.5}
  .discover-ad-bottom{gap:12px;flex-wrap:wrap}
  .discover-ad-arrow{width:44px;height:44px;min-width:44px}
  .discover-ad-cta{min-height:44px;padding:10px 13px}
  .discover-page .section-title .org-actions{gap:6px;flex-shrink:0}
  .discover-page .section-title .more-link{padding-inline:9px}
  .discover-ranked-account{min-width:145px;flex-basis:145px!important;border-radius:17px}
  .group-hot-grid{grid-template-columns:1fr;gap:11px}
  .booking-project-card{column-gap:12px}
  .booking-time-row{grid-template-columns:1fr}
  .chat-detail .chat-compose{gap:6px;padding:9px max(12px,env(safe-area-inset-right,0px)) calc(9px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))}
  .chat-compose .hidden{display:none!important}
  .chat-detail .chat-compose .voice-hold{height:46px;min-height:46px}
  .chat-detail #chatInput{font-size:16px;min-height:46px}
  .chat-detail .chat-list{padding-inline:14px}
  .chat-detail .chat-person-head{padding:10px 14px}
  .chat-detail .dm-permission-notice{font-size:11px;line-height:1.6;margin-bottom:8px}
  .chat-detail .chat-bubble{font-size:15px;line-height:1.65;overflow-wrap:anywhere}
  .network-auth-gate{padding:calc(14px + env(safe-area-inset-top,0px)) max(14px,env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px))}
  .network-auth-card{width:100%;max-width:440px;border-radius:23px}
  .auth-intro{padding:23px 22px 0}
  .auth-controls{padding:15px 22px 24px}
  .auth-hero-copy{margin:21px 0 7px}
  .auth-kicker{display:none}
  .auth-hero-copy h2{font-size:25px;margin:0 0 10px;line-height:1.4}
  .auth-hero-copy>.muted{font-size:11px;line-height:1.8;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal}
  .network-auth-tabs{margin-bottom:17px}
  .network-auth-tabs button{min-height:44px}
  .auth-form{gap:14px}
  .auth-form .input{height:48px}
  .password-field button{min-width:48px;min-height:44px}
  .network-server-box{margin-top:18px}
  .toast{bottom:calc(var(--mobile-bottom-height) + 14px);max-width:calc(100vw - 32px);line-height:1.65}
  .mobile-keyboard-open .toast{bottom:18px}
  .admin-workspace .admin-tools-grid{gap:10px}
  .admin-workspace .admin-tool-card{padding:14px;min-height:112px}
}
@media (max-width:359px) {
  .home-tool{gap:7px;padding:10px}
  .home-tool small{font-size:9px}
  .campus-hero{padding:17px 18px;min-height:146px}
  .campus-hero h2{font-size:21px}
  .campus-hero p{display:none}
  .hero-art{right:-66px;opacity:.2}
  .publish-page .dual{grid-template-columns:1fr}
  .actions button{font-size:9px;gap:3px}
  .network-auth-brand .auth-brand-name{font-size:18px}
  .network-auth-brand .auth-brand-name small{font-size:6px;letter-spacing:1px}
  .auth-intro{padding-inline:19px}
  .auth-controls{padding-inline:19px}
}
@media (max-width:1023px) and (pointer:coarse) and (max-height:600px) {
  .main-header{padding-top:max(8px,env(safe-area-inset-top,0px));padding-bottom:8px}
  .main-header .subtitle{display:none}
  .header-line{min-height:40px}
  .search-wrap{margin-top:7px}
  .bottom{min-height:56px;padding-top:4px;padding-bottom:calc(4px + env(safe-area-inset-bottom,0px))}
  .bottom button{min-height:44px;flex-direction:row;gap:8px}
  .bottom button small{font-size:11px}
  .bottom .publish-nav>span{width:32px;height:30px}
  .campus-hero{min-height:136px;padding-block:15px}
  .scanner-frame,.scanner-frame video{max-height:44dvh}
}
