/* One viewport, three normal-flow rows: header / active view / navigation.
   The composer is the last row inside chat, never a separately fixed overlay. */
:root{--screen-top:max(env(safe-area-inset-top,0px),var(--native-top-fallback,0px));--screen-bottom:env(safe-area-inset-bottom,0px);--app-gutter:16px;--app-viewport-height:100dvh;--app-viewport-top:0px;--app-top:calc(var(--screen-top) + 12px);--app-nav:calc(68px + var(--screen-bottom));--app-content-height:100%}
html.app-viewport-locked,body.app-lock-scroll{height:100%;overflow:hidden!important;overscroll-behavior:none}
body.app-lock-scroll .shell{min-height:0;height:var(--app-viewport-height);overflow:hidden}
body.app-lock-scroll #app.app-view{position:fixed;top:var(--app-viewport-top);bottom:auto;left:50%;transform:translateX(-50%);width:100%;max-width:480px;height:var(--app-viewport-height)!important;min-height:0!important;display:flex;flex-direction:column;overflow:hidden;padding:var(--app-top) var(--app-gutter) 0!important;box-sizing:border-box}
#app.app-view>header{flex:0 0 44px;height:44px;margin:0 0 10px;gap:12px}
.app-view>header .brand-lockup{min-width:0;gap:6px}
.app-view>header .wordmark{font-size:29px;line-height:1}
.app-view>header .member-pill{flex:none;min-height:36px;padding:8px 12px;white-space:nowrap}
body.app-lock-scroll #app>.tab-content:not(.hidden){flex:1 1 0;height:auto!important;min-height:0!important;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:12px}
body.app-lock-scroll #app>nav{position:static!important;inset:auto!important;transform:none!important;flex:0 0 auto;max-width:none;width:calc(100% + 2 * var(--app-gutter));height:var(--app-nav);min-height:var(--app-nav);margin:0 calc(-1 * var(--app-gutter));padding:8px 10px calc(8px + var(--screen-bottom));box-sizing:border-box;align-items:flex-start;z-index:30}
.app-view>nav button{min-height:48px;min-width:44px}
body.app-lock-scroll #app>#discover{--discovery-action-size:56px;--discovery-star-size:48px;--discovery-action-row:64px;display:grid;overflow:hidden;padding-bottom:8px;grid-template-rows:36px minmax(0,1fr) 14px var(--discovery-action-row);gap:5px}
#discover .swipe-actions{grid-row:4;grid-column:1;height:var(--discovery-action-row);display:grid;grid-template-columns:var(--discovery-action-size) var(--discovery-star-size) var(--discovery-action-size);justify-content:center;align-items:center;justify-items:center;gap:clamp(14px,4vw,22px);width:100%;padding:0;transform:none!important;margin:0;align-self:stretch}
#discover .swipe-actions button{box-sizing:border-box;display:grid;place-items:center;flex:none;width:var(--discovery-action-size);height:var(--discovery-action-size);min-width:var(--discovery-action-size);min-height:var(--discovery-action-size);max-width:var(--discovery-action-size);max-height:var(--discovery-action-size);padding:0;margin:0;border:0;border-radius:50%;line-height:1;appearance:none;-webkit-appearance:none;overflow:hidden}
#discover .swipe-actions .star{width:var(--discovery-star-size);height:var(--discovery-star-size);min-width:var(--discovery-star-size);min-height:var(--discovery-star-size);max-width:var(--discovery-star-size);max-height:var(--discovery-star-size)}
#discover .swipe-actions svg{display:block;width:27px;height:27px;flex:none;pointer-events:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#discover .swipe-actions .star svg{width:22px;height:22px;fill:currentColor;stroke:none}
#discover .swipe-actions .like svg{fill:currentColor;stroke:none}
#discover>.swipe-tip{display:none!important}
#discover .discovery-head{grid-row:1;margin:0 2px}
#discover .card{grid-row:2;min-height:0!important}
#discover #card-media-pagination{grid-row:3;grid-column:1;height:14px;margin:0;align-self:center}
#messages>h2,#me .me-head h2{margin:0;font-size:26px;line-height:1.25}
#messages>.message-likes-promo{margin:12px 0}
#messages .chat-row{min-width:0}
#messages .chat-row>div:not(.avatar){min-width:0}
#messages .chat-row p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#member-upgrade>.eyebrow{margin:2px 0 8px}
#member-upgrade>h2{font-size:clamp(26px,7.4vw,32px);line-height:1.2;margin:0 0 10px}
#member-upgrade>.muted{margin-bottom:20px}
#member-active{padding-top:0}
#me .me-head{margin:0 0 16px}
#me .me-summary{padding-bottom:16px}
body.app-lock-scroll #app>#chat,body.app-lock-scroll #app>#premium-service{display:flex;flex-direction:column;overflow:hidden;padding:0!important}
body.app-lock-scroll #chat>.back{flex:none;height:30px;min-height:30px;line-height:1;padding:0 0 4px;margin:0 0 4px}
body.app-lock-scroll #chat>.chat-profile-preview{flex:none;margin:0 0 8px}
body.app-lock-scroll #chat>.notice{flex:none;margin:0 0 8px;padding:9px 11px;line-height:1.45}
body.app-lock-scroll #chat>.bubbles,body.app-lock-scroll #premium-service>.bubbles{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 2px 10px;overflow-anchor:none}
body.app-lock-scroll #chat>.composer,body.app-lock-scroll #premium-service>.composer{position:static!important;inset:auto!important;transform:none!important;width:100%;max-width:none;flex:0 0 auto;margin:0!important;padding:6px 0!important;gap:7px;display:flex;align-items:center;background:#fffcf8;border-top:1px solid #eee7e1;z-index:auto;box-sizing:border-box}
body.app-lock-scroll #chat>.composer input,body.app-lock-scroll #premium-service>.composer input{margin:0;flex:1;min-width:0;height:44px;min-height:44px;padding:9px 11px;font-size:16px;line-height:24px}
body.app-lock-scroll #chat>.composer button,body.app-lock-scroll #premium-service>.composer button{flex:none;width:44px;height:44px;min-height:44px;padding:0;display:grid;place-items:center}
body.app-lock-scroll #chat>.chat-tools{position:static!important;inset:auto!important;flex:none;margin:0 0 6px;max-height:180px;overflow-y:auto}
body.app-lock-scroll #chat>.message-send-status{flex:none;margin:0!important;min-height:0;font-size:11px;line-height:16px}
body.app-lock-scroll #chat>.message-send-status:empty{display:none}
body.app-lock-scroll #chat>.message-send-status:not(:empty){padding:2px 0}
body.app-lock-scroll #app[data-keyboard-open]>nav,body.app-lock-scroll #app[data-keyboard-open]>header{display:none!important}
body.app-lock-scroll #app[data-keyboard-open]{padding-top:0!important}
body.app-lock-scroll #app[data-keyboard-open] #chat>.chat-profile-preview,body.app-lock-scroll #app[data-keyboard-open] #chat>.notice{display:none}
@media(max-height:700px){body.app-lock-scroll #app>#discover{--discovery-action-size:48px;--discovery-star-size:44px;--discovery-action-row:56px;grid-template-rows:34px minmax(0,1fr) 14px var(--discovery-action-row)!important;gap:3px!important}#discover .card-copy{bottom:12px}#discover .card-copy h2{font-size:25px}#discover .card-copy .bio{font-size:11px;line-height:1.35}}
@media(max-width:350px){:root{--app-gutter:12px}.app-view>header .wordmark{font-size:26px}.app-view>header .member-pill{font-size:10px;padding:7px 10px}#discover .card-copy{left:15px;right:15px}.tap-hint{font-size:9px;right:10px}}
@media(orientation:landscape) and (max-height:500px){body.app-lock-scroll #app:has(>#discover:not(.hidden))>header{display:none}body.app-lock-scroll #app>#discover{--discovery-action-size:44px;--discovery-star-size:44px;display:grid;grid-template-columns:minmax(0,1fr) 60px;grid-template-rows:30px minmax(0,1fr) 12px!important;gap:4px!important;overflow:hidden;padding-bottom:8px}#discover .discovery-head{grid-row:1;grid-column:1/-1;margin:0 2px}#discover .card{grid-row:2;grid-column:1;height:auto!important;min-height:0!important}#discover #card-media-pagination{grid-row:3;grid-column:1;height:12px;margin:0}#discover .swipe-actions{grid-row:2/4;grid-column:2;grid-template-columns:44px;grid-template-rows:repeat(3,44px);align-content:center;justify-content:center;gap:6px;width:60px;height:100%;margin:0}#discover .limit-overlay,#discover .discovery-empty-overlay{padding:8px;gap:5px}#discover .limit-overlay>b{font-size:22px;line-height:1}#discover .limit-overlay h3{font-size:15px;line-height:1.2;margin:0}#discover .limit-overlay p,#discover .discovery-empty-overlay p{font-size:11px;line-height:1.3;margin:0;max-width:none}#discover .limit-overlay button,#discover .discovery-empty-overlay button{min-height:36px;padding:6px 12px;margin:0;font-size:12px}#discover .discovery-empty-overlay b{font-size:15px}#discover .card-copy .bio{display:none}body.app-lock-scroll #chat>.chat-profile-preview,body.app-lock-scroll #chat>.notice{display:none}}
