/* Device layouts and composer sizing shared by every web route. */
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html,body{width:100%;max-width:100%;margin:0}
body{font-size:16px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,textarea,select{font-family:inherit}
.page-title,.brand-name,.drawer-head h2{font-family:Inter,ui-sans-serif,system-ui,sans-serif}
img,video{max-width:100%;height:auto}
.app-shell,.main-content,.page,.card,.chat-panel,.message-stream,.message-wrap{min-width:0;max-width:100%}
.page-title{font-size:clamp(22px,2.3vw,30px);line-height:1.15;letter-spacing:-.035em}
.page-head{gap:12px;flex-wrap:wrap}
.page-head>div,.chat-head>div{min-width:0}
.page-subtitle{font-size:14px;line-height:1.5}
.button{font-size:14px;min-height:42px;padding:10px 14px;white-space:normal}
.card-actions,.actions{flex-wrap:wrap;gap:8px}
.message-form{display:flex!important;align-items:flex-end;gap:4px;padding:8px;flex:0 0 auto;min-width:0}
.message-form textarea{width:0;flex:1 1 0;min-width:0;min-height:42px;max-height:100px;padding:10px 9px;font-size:16px;line-height:22px}
.message-attachment,.message-voice-button,.message-send{display:flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;min-width:0;height:42px;min-height:42px;padding:0;border-radius:14px;font-size:16px;cursor:pointer}
.message-form .gif-trigger{font-size:12px}
.message-voice-button{background:#167A52;color:#fff;border:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.message-voice-button.recording{background:#D63B49;box-shadow:0 0 0 4px #fbe2e5}
.message-voice-button.cancel{background:#66716b}
.message-voice-button[aria-busy=true]{opacity:.6}
.message-send{font-size:13px;background:#167A52;color:white;border:0}
.message-recording-bar{display:flex;align-items:center;gap:8px;flex:0 0 auto;padding:10px 12px;background:#fff1f2;color:#a61c2e;font-size:12px;flex-wrap:wrap}
.message-recording-bar button{min-height:40px;border:0;border-radius:10px;padding:6px 10px;color:#a61c2e;background:#ffe0e5;cursor:pointer}
.recording-dot{width:9px;height:9px;border-radius:50%;background:#d63b49;animation:record-pulse 1s infinite}
@keyframes record-pulse{50%{opacity:.35}}
.message-voice{display:flex;align-items:center;gap:9px;width:240px;max-width:100%;min-width:0;padding:4px}
.message-voice audio{display:none}
.voice-play{flex:0 0 40px;width:40px;height:40px;border-radius:50%;background:#167A52;color:white;border:0;font-size:17px;cursor:pointer}
.voice-track{min-width:0;flex:1;display:grid;gap:2px}
.voice-seek{width:100%;min-width:0;height:26px;margin:0;accent-color:#167A52;cursor:pointer}
.voice-time{font-size:12px;color:#63746b;white-space:nowrap}
.message-bubble.mine .voice-play{background:white;color:#167A52}
.message-bubble.mine .voice-time{color:inherit}
.message-bubble.mine .voice-seek{accent-color:#bce8ce}
.message-bubble{max-width:85%;overflow-wrap:anywhere;min-width:0}
.message-media,.message-gif{max-width:100%;max-height:360px;object-fit:contain}
.chat-head strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px}
.chat-head span{font-size:12px}
.chat-info{flex:0 0 40px;width:40px;height:40px;border:0;border-radius:12px;background:#edf6f0;color:#167A52;font-size:21px;cursor:pointer}
.shared-message-media{display:grid;gap:10px}
.toast-region{pointer-events:none}
.chat-members-button{max-width:72px;font-size:12px;padding:6px;min-width:0}
.message-stream{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1 1 0}
.chat-panel{min-height:0;height:100%;overflow:hidden}
.messaging-shell{min-height:0;height:min(680px,calc(100dvh - 240px));grid-template-columns:minmax(240px,30%) minmax(0,1fr)}
.conversation-list{min-width:0;overflow-y:auto}
.conversation-row>span{min-width:0}
.conversation-row small,.conversation-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.composer-reply,.message-media-preview{flex:0 0 auto;max-height:110px;overflow:auto}
.feed-copy,.message-bubble p{overflow-wrap:anywhere}
.message-bubble p{font-family:Inter,ui-sans-serif,system-ui,sans-serif;font-size:15px;line-height:1.45}
.topbar{min-width:0;gap:8px}
.topbar-left,.topbar-actions{min-width:0;gap:6px}
.topbar .brand{min-width:0;gap:5px}
.brand-name{white-space:nowrap;font-size:18px}
.topbar .icon-button,.avatar-button{width:40px;height:40px;flex:0 0 40px}
.mobile-tabbar button{min-width:0;flex:1}
.mobile-tabbar small{font-size:11px;white-space:nowrap}
@media(max-width:640px){
  body:has(.mobile-chat-open) .main-content{isolation:auto;z-index:1100}
  body:has(.mobile-chat-open) .topbar,body:has(.mobile-chat-open) .mobile-tabbar{visibility:hidden}
  body:has(.mobile-chat-open) .toast-region{bottom:calc(70px + env(safe-area-inset-bottom))}
  .main-content{width:100%;padding:0 0 calc(74px + env(safe-area-inset-bottom))!important}
  .page,.page-narrow,.feed-page,.messages-page{width:100%!important;max-width:100%!important;margin:0!important;padding:12px!important}
  .feed-page{padding:10px 0!important}
  .native-feed-head{padding:0 10px}
  .feed-card{width:100%;margin:0 0 10px;border-radius:0!important;border-left:0;border-right:0}
  .page-title{font-size:22px}
  .page-head{margin-bottom:12px;gap:8px}
  .page-head .actions{gap:6px}
  .button{min-height:40px;padding:8px 11px;font-size:14px}
  .card,.feature-card{padding:14px}
  .feed-card{padding:12px 0 0}
  .community-grid{grid-template-columns:minmax(0,1fr)}
  .church-filter-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;overflow:visible;padding:4px}
  .church-filter-tabs button{min-width:0;padding:8px 4px;font-size:13px;white-space:normal}
  .topbar{height:58px;min-height:58px;padding:0 8px!important;display:flex;justify-content:space-between}
  .topbar-left{flex:1;overflow:hidden}
  .brand-name{font-size:clamp(14px,4vw,18px)!important;display:inline!important}
  .brand-mark{width:24px;height:24px;flex:0 0 24px}
  .topbar-actions{gap:2px}
  .topbar .search-trigger{display:none}
  .pinned-shortcuts{display:none!important}
  .mobile-tabbar{width:100%;max-width:100%;left:0;right:0;transform:none;border-radius:0;padding:6px 2px calc(6px + env(safe-area-inset-bottom));min-height:66px}
  .mobile-tabbar button{padding:4px 0}
  .messages-page{padding:10px 0!important}
  .messages-page .page-head{padding:0 12px!important}
  .messaging-shell{height:auto;min-height:calc(100dvh - 240px);grid-template-columns:minmax(0,1fr);border:0;border-radius:0}
  .messages-page.mobile-chat-open .chat-panel{position:fixed;inset:auto;top:var(--visible-top,0px);left:0;right:0;width:100%;max-width:100%;height:var(--visible-height,100dvh);min-height:0;z-index:60;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);display:flex!important;background:white}
  .messages-page.mobile-chat-open .message-form{position:relative;bottom:auto;padding:6px;gap:3px}
  .messages-page.mobile-chat-open .message-stream{padding:10px;min-height:0;flex:1 1 0}
  .messages-page.mobile-chat-open .chat-head{padding:8px;min-height:58px;gap:8px;flex:0 0 auto}
  .chat-head>div{flex:1}
  .chat-back{display:flex;width:40px;height:40px;flex:0 0 40px;align-items:center;justify-content:center}
  .message-form textarea{border-radius:18px;min-height:42px}
  .message-attachment,.message-voice-button,.message-send{flex-basis:40px;width:40px;height:42px}
  .message-bubble{max-width:86%}
  .modal-backdrop{padding:0;align-items:flex-end}
  .modal{width:100%!important;max-width:100%!important;max-height:var(--visible-height,92dvh)!important;overflow-y:auto;padding:18px 14px calc(18px + env(safe-area-inset-bottom));border-radius:20px 20px 0 0!important}
  .modal h2{font-size:22px}
  .form-grid,.composer-grid{grid-template-columns:minmax(0,1fr)}
  input,select,textarea{max-width:100%;min-width:0}
  .profile-stats{gap:8px}
  .profile-header{padding:14px}
  .discover-card{max-width:100%;min-width:0}
}
@media(min-width:641px) and (max-width:1024px){
  .page,.messages-page{width:100%;max-width:100%;padding:18px}
  .messaging-shell{grid-template-columns:minmax(220px,32%) minmax(0,1fr);height:calc(100dvh - 265px);min-height:400px}
  .community-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .feed-page{max-width:760px}
}
@media(min-width:641px){
  .messages-page{display:grid;grid-template-rows:auto auto auto minmax(0,1fr);gap:10px;height:calc(100dvh - 140px);min-height:440px;padding-top:16px;padding-bottom:0}
  .messages-page .page-head{margin:0;align-items:center}
  .messages-page .eyebrow,.messages-page .page-subtitle{display:none}
  .messages-page .page-title{margin:0}
  .messages-page .message-search{margin:0}
  .messages-page .active-contacts{margin:0;padding:8px 12px}
  .messages-page .active-contacts-title{margin-bottom:4px}
  .messages-page .active-avatar{width:32px;height:32px}
  .messages-page .active-contacts-scroll button{min-width:44px;width:44px}
  .messages-page .messaging-shell{height:100%;min-height:0;margin:0;padding:0}
}
@media(min-width:1025px){
  .topbar{padding-left:24px;padding-right:24px}
  .page{width:min(1280px,calc(100% - 48px));max-width:1280px;margin:0 auto;padding:24px 0}
  .messages-page{width:min(1280px,calc(100% - 48px));max-width:1280px}
  .feed-page{width:min(1100px,calc(100% - 48px));max-width:1100px;display:grid;grid-template-columns:250px minmax(0,720px);gap:24px;align-items:start}
  .native-feed-head{position:sticky;top:90px}
  .feed-list{min-width:0}
  .messages-page .messaging-shell{min-height:0;height:100%}
  .mobile-tabbar{max-width:640px}
}

/* Web proportions: shared rhythm, bounded reading widths, and device-sized media. */
.room-create-friends{align-items:flex-start;gap:12px;padding:8px 4px 12px;scrollbar-width:thin;scrollbar-color:#cbd8d0 transparent}
.room-create-friends label{position:relative;display:grid;justify-items:center;grid-template-rows:54px auto;gap:8px;flex:0 0 76px;min-width:0;padding:4px 2px;cursor:pointer}
.room-create-avatar{display:grid;place-items:center;overflow:hidden;flex:none;line-height:1;font-size:1rem;font-weight:700;color:#167a52;background:#edf5f0;box-sizing:border-box}
.room-create-avatar img{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;object-position:center;border-radius:inherit}
.room-create-friends label>span:last-child{width:100%;margin:0;font-size:.875rem;font-weight:650;line-height:1.4;white-space:nowrap}
.room-create-friends input:checked+.room-create-avatar{border-color:#167a52;background:#dff0e5;box-shadow:0 0 0 3px #167a5226}
.room-create-friends input:focus-visible+.room-create-avatar{outline:3px solid #167a52;outline-offset:3px}
:root{--canvas:#f4f7f6;--line:#e1e9e5;--muted:#62736b;--bc-muted:#62736b;--shadow-sm:0 2px 12px #173f2b08}
body{background:var(--canvas);line-height:1.5}
.auth-mode .mobile-tabbar{display:none!important}
.auth-mode .main-content{padding:0!important}
.topbar{background:#fff;border-bottom-color:var(--line)}
.page-narrow{max-width:800px}
.page-title,.profile-heading h1,.create-post-header h1,.church-card h3,.profile-section-head h2{font-family:inherit;letter-spacing:-.035em;line-height:1.2}
.page-title{font-size:clamp(1.5rem,2.3vw,1.875rem)}
.eyebrow{font-size:.75rem;line-height:1.5;letter-spacing:.09em}
.page-subtitle{font-size:.9375rem;margin-top:8px}
.card,.stat-card{border-color:var(--line)}
.card h3,.feature-card h3{overflow-wrap:anywhere}
.button{border-radius:12px;font-weight:650;line-height:1.35}
.button-small{font-size:.875rem}
.search-field input,.field input,.field select,.field textarea{font-size:1rem;min-height:46px}
.composer-grid label,.composer-conditional label{font-size:.875rem;font-weight:650;min-width:0}
.composer-grid input,.composer-grid select,.composer-conditional input,.composer-conditional select,.composer-conditional textarea{font-size:1rem;font-weight:400}
.feed-list{margin-top:0;gap:16px}
.feed-card{padding:16px 0 0;margin:0;border-radius:18px;box-shadow:var(--shadow-sm)}
.feed-author,.feed-copy,.feed-counts{padding-inline:18px}
.feed-author-link{flex:1;min-width:0}
.feed-author-link strong{overflow-wrap:anywhere;font-size:.9375rem;line-height:1.4}
.feed-avatar,.composer-avatar{width:42px;height:42px;flex:0 0 42px}
.feed-copy{font-size:1rem;line-height:1.65;margin:14px 0}
.feed-media{display:block;width:100%;max-width:100%;height:auto;max-height:min(580px,70dvh);margin:12px 0 0;object-fit:contain;background:#edf2ef}
.feed-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:4px 8px}
.feed-actions .reaction-button{min-width:0;min-height:44px;justify-content:center;font-size:.875rem;padding:8px 4px}
.native-home-actions button{min-height:48px;border-radius:12px}
.native-home-actions button small{font-size:.875rem}
.feed-compose-trigger{margin:0;gap:10px;border-radius:16px}
.feed-compose-trigger span:nth-child(2){min-width:0;font-size:.9375rem;padding:10px 12px;line-height:1.4}
.feed-compose-trigger b{flex:0 0 30px}
.profile-heading{flex-wrap:wrap;align-items:center;gap:16px}
.profile-heading>div{min-width:0}
.profile-heading h1{font-size:clamp(1.5rem,2.8vw,2rem);overflow-wrap:anywhere}
.profile-heading p,.profile-about{overflow-wrap:anywhere}
.profile-heading .actions{gap:8px}
.profile-friend{flex-basis:96px}
.profile-friend-avatar{width:72px;height:72px}
.profile-section-head h2{font-size:1.25rem}
.profile-friends-empty{flex-wrap:wrap}
.discover-card{width:min(100%,440px);margin-inline:auto;border-radius:20px}
.discover-photo,.discover-preview-card .discover-photo{min-height:0;aspect-ratio:4/5;max-height:480px}
.discover-photo-shade h2{font-size:clamp(1.5rem,3vw,1.875rem)}
.discover-card-body{padding:16px 20px 8px;font-size:1rem}
.discover-round{width:50px;height:50px}
.discover-head-actions{flex-wrap:wrap}
.church-grid,.community-grid,.people-grid,.settings-grid{gap:16px}
.church-card,.feature-card,.settings-card{padding:20px;border-radius:16px}
.church-card h3,.feature-card h3{font-size:1.125rem;line-height:1.35}
.church-card p,.feature-card p{font-size:1rem;line-height:1.55}
.modal{width:min(620px,calc(100vw - 40px));max-height:calc(100dvh - 48px);overflow-y:auto;border-radius:20px}
.form-grid>*,.composer-grid>*,.settings-grid>*{min-width:0}
.room-welcome h2{font-size:clamp(1.75rem,3vw,2.5rem)}
.room-sidebar-head h1{font-size:1.75rem}
.room-filter-tabs button{font-size:.875rem}
.room-card-join{font-size:.875rem}
.message-bubble p{font-size:1rem;line-height:1.5}
.message-voice{min-width:0}
.chat-head>div{flex:1;min-width:0}
.message-stream{max-height:none}
.message-form{padding:12px;gap:6px}
.message-form textarea{background:#f4f7f5;border-color:#e3ebe6;border-radius:18px;padding-inline:13px}
.message-attachment{background:#eff5f1;border-radius:12px}
.conversation-row{padding:14px 16px;min-height:76px}
.conversation-row.active{background:#eaf5ee;box-shadow:inset 3px 0 #167a52}
.conversation-row strong{font-size:.9375rem}
.conversation-row small{font-size:.875rem}
.message-stream{background:#f5f8f6}
.auth-card{width:min(460px,100%)}
.auth-intro{font-size:1rem;line-height:1.55}
.auth-note{font-size:.8125rem}
@media(min-width:641px){
  .topbar{padding-inline:24px}
  .page{width:min(1120px,calc(100% - 48px));padding:24px 0 32px}
  .page.page-narrow{width:min(800px,calc(100% - 48px));max-width:800px}
  .page.create-post-page{max-width:680px}
  .page.feed-page{width:min(720px,calc(100% - 48px));max-width:720px;display:block}
  .native-feed-head{position:static;margin-bottom:16px;padding:0}
  .messages-page{height:calc(100dvh - 150px);min-height:440px;grid-template-rows:auto auto auto minmax(0,1fr);padding-block:20px 0}
  .messages-page .messaging-shell{height:100%;min-height:0;grid-template-columns:minmax(220px,30%) minmax(0,1fr);border-radius:18px;box-shadow:var(--shadow-sm)}
  .messages-page .page-title{font-size:1.75rem}
  .chat-head{min-height:70px;padding:12px 18px}
  .message-stream{padding:20px}
  .profile-card .cover{height:200px}
  .profile-posts{margin-inline:auto;max-width:680px}
  .create-post-form textarea{font-size:1.125rem;min-height:180px}
}
@media(min-width:1025px){
  .page.feed-page{width:min(1020px,calc(100% - 64px));max-width:1020px;display:grid;grid-template-columns:280px minmax(0,680px);gap:28px;justify-content:center}
  .native-feed-head{position:sticky;top:88px;padding:16px;background:white;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow-sm)}
  .feed-compose-trigger{flex-wrap:wrap;padding:0;border:0;background:transparent}
  .feed-compose-trigger span:nth-child(2){flex:1 1 170px;order:2}
  .feed-compose-trigger b{margin-left:auto}
  .native-home-actions{grid-template-columns:1fr;gap:6px}
  .native-home-actions button{justify-content:flex-start;padding:0 14px;border-color:transparent;background:#f5f8f6;gap:12px}
  .native-home-actions button span{width:24px;text-align:center}
  .church-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(min-width:1200px){
  .topbar{height:72px;min-height:72px;padding-inline:32px;display:flex;justify-content:space-between}
  .topbar-left{flex:none}
  .brand-name{font-size:1.125rem;letter-spacing:-.035em}
  .mobile-tabbar{top:10px;bottom:auto;left:50%;width:500px;max-width:500px;min-height:52px;transform:translateX(-50%);padding:4px;border:0;border-radius:14px;background:#f3f7f5;box-shadow:none}
  .mobile-tabbar button{flex:1;flex-direction:row;gap:8px;min-height:44px;border-radius:10px;cursor:pointer}
  .mobile-tabbar small{font-size:.875rem}
  .mobile-tabbar button.active{background:#fff;box-shadow:0 2px 6px #173f2b0c}
  .mobile-tabbar .tab-create{flex:1;transform:none;width:auto;height:auto;margin:0;background:transparent!important;border-radius:10px;box-shadow:none}
  .mobile-tabbar .tab-create>span{width:24px;height:24px;font-size:24px;background:transparent;color:#167a52;box-shadow:none}
  .mobile-tabbar .tab-create small{position:static;margin:0;font-weight:650}
  .main-content{min-height:calc(100dvh - 72px);padding-bottom:24px}
  .auth-mode .main-content{padding:0}
  .messages-page{height:calc(100dvh - 104px)}
  .native-feed-head{top:100px}
  .live-rooms-page.has-selection .room-controls{bottom:16px}
}
@media(max-width:640px){
  .feed-list{gap:10px}
  .feed-card{padding:14px 0 0}
  .feed-author,.feed-copy,.feed-counts{padding-inline:14px}
  .feed-media{margin:12px 0 0;width:100%;max-height:65dvh}
  .native-feed-head{margin-bottom:14px;padding:0 12px}
  .native-home-actions button{gap:6px;min-height:48px}
  .native-home-actions button small{font-size:.8125rem}
  .feed-actions .reaction-button{font-size:.8125rem}
  .page-head{flex-direction:row;align-items:center;gap:12px}
  .page-head>div:first-child{flex:1 1 180px}
  .page-head .actions{flex:1 1 auto}
  .page-head .actions .button{flex:1}
  .profile-details{padding:0 16px 20px}
  .profile-heading .actions .button{flex:1 1 140px}
  .profile-card .cover{height:150px}
  .profile-friends{padding:16px}
  .discover-photo,.discover-preview-card .discover-photo{max-height:420px}
  .church-card,.feature-card,.settings-card{padding:16px}
  .church-filter-tabs button{font-size:.875rem}
  .create-post-header h1{font-size:1.375rem}
  .create-post-form textarea{min-height:160px;font-size:1rem}
  .message-form{gap:4px;padding:8px}
  .room-filter-tabs button{font-size:.8125rem}
  .live-rooms-page.has-selection .room-controls .button{font-size:.875rem}
  .mobile-tabbar .tab-create{transform:none;flex:1;width:auto;height:auto;background:transparent!important;box-shadow:none;margin:0;color:#167a52!important}
  .mobile-tabbar .tab-create>span{width:42px;height:42px;font-size:26px;box-shadow:none}
  .mobile-tabbar .tab-create small{position:static;margin:2px 0 0;font-size:11px}
}
@media(max-width:360px){
  .message-attachment{flex-basis:34px;width:34px}
  .messages-page.mobile-chat-open .message-form{gap:2px;padding-inline:4px}
  .message-form textarea{padding-inline:8px}
}
