/* Murmur final layout and visibility repair layer.
   Loaded after the design layers so native hidden state and responsive sizing win. */
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html,body{width:100%;min-width:320px;max-width:100%;margin:0;overflow-x:hidden}
body{min-height:100vh;min-height:100dvh}
#app,#auth{width:100%;min-width:0}
img,video,canvas,iframe{display:block;max-width:100%}
button,input,select,textarea{font:inherit;min-width:0}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.6}
.fb-head{width:100%;min-width:0}
.fb-head .topbar,.fb-nav{min-width:0}
.fb-nav button{flex:1 1 0;min-width:0}
.fb-nav button svg{pointer-events:none}
.main{width:min(100%,1440px);min-width:0;margin-inline:auto}
.pane{display:none;min-width:0;width:100%}
.pane.active:not([hidden]){display:block}
.pane>*{min-width:0;max-width:100%}
.posts,.stories,.alerts-list,.chat-list,.fr-list{min-width:0}
.post,.card,.composer,.fr-block,.notice,.alerts-row{min-width:0;overflow-wrap:anywhere}
.post img,.post video{width:100%;height:auto;object-fit:contain}
input,select,textarea{max-width:100%}
.auth-card,.panel,.auth-card .panel{min-width:0}
.chat-layout{min-width:0}
.chat-layout .sidebar,.chat-layout .conversation{min-width:0}
.messages{min-width:0;overflow-x:hidden;overscroll-behavior:contain}
.bubble{max-width:min(82%,620px);overflow-wrap:anywhere;white-space:pre-wrap}
.murmur-menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:780px){
  .main{padding-inline:12px}
  .fb-nav{gap:3px}
  .fb-nav button{padding-inline:3px}
  .murmur-menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chat-layout{display:block;width:100%}
  .chat-layout:not(.open) .conversation{display:none}
  .chat-layout.open .sidebar{display:none}
  .chat-layout.open .conversation{display:flex}
}
@media(max-width:420px){
  .main{padding-inline:10px}
  .post,.composer{border-radius:15px}
  .fb-logo{font-size:1.35rem}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}
}


/* Chat recovery: visible conversation controls, readable threads and touch-safe layout. */
.chat-layout{display:grid;grid-template-columns:minmax(250px,340px) minmax(0,1fr);gap:16px;align-items:stretch}
.chat-layout .sidebar,.chat-layout .conversation{min-width:0;min-height:560px}
.chat-list{min-width:0;overflow-y:auto;overscroll-behavior:contain}
.chat-list-item{width:100%;min-width:0;display:flex;align-items:center;gap:12px;padding:12px 14px;border:0;border-top:1px solid var(--line);background:transparent;color:var(--ink);text-align:left;cursor:pointer}
.chat-list-item:hover,.chat-list-item.active{background:rgba(18,185,149,.09)}
.chat-list-item .avatar{width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;border-radius:50%;background:rgba(18,185,149,.14);font-weight:750}
.chat-list-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}
.chat-list-copy strong,.chat-list-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-list-copy small,.chat-list-time{font-size:.8rem;color:var(--muted)}
.chat-list-time{flex:0 0 auto}
.conversation{display:flex;flex-direction:column;min-width:0;overflow:hidden}
.conversation-header{min-width:0;flex:0 0 auto}
.chat-back{display:none;flex:0 0 40px;width:40px;height:40px;place-items:center;border:0;border-radius:12px;background:var(--surface-soft,#f5f8f7);color:var(--ink);font-size:1.25rem}
.messages{display:flex;flex:1;min-height:0;flex-direction:column;gap:10px;overflow-y:auto;overflow-x:hidden;padding:16px;overscroll-behavior:contain}
.message-row{align-self:flex-start;max-width:min(82%,620px);min-width:48px;padding:10px 13px;border:1px solid var(--line);border-radius:16px 16px 16px 5px;background:var(--surface-soft,#f5f8f7);color:var(--ink);overflow-wrap:anywhere}
.message-row p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.message-row time{display:block;margin-top:5px;font-size:.68rem;color:var(--muted);text-align:right}
.message-row.mine{align-self:flex-end;border-color:transparent;border-radius:16px 16px 5px 16px;background:var(--acc);color:var(--on)}
.message-row.mine time{color:rgba(4,38,30,.7)}
.composer-chat{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;flex:0 0 auto;padding:12px;border-top:1px solid var(--line);padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
.composer-chat input{min-width:0}
@media(max-width:780px){
  .chat-layout{display:block;width:100%;min-height:0}
  .chat-layout .sidebar{display:flex;width:100%;min-height:0;max-height:none}
  .chat-layout .conversation{display:none}
  .chat-layout.open .sidebar{display:none}
  .chat-layout.open .conversation{display:flex;position:fixed;inset:0;z-index:90;width:100%;height:100vh;height:100dvh;min-height:0;max-height:100dvh;border:0;border-radius:0;padding-bottom:env(safe-area-inset-bottom,0px)}
  .chat-layout.open .chat-back{display:grid}
  .chat-layout.open .messages{min-height:0;flex:1}
  .chat-layout.open .conversation-header{padding:10px 12px}
  .chat-layout.open .composer-chat{padding-inline:12px}
}
@media(max-width:380px){
  .chat-list-item{gap:9px;padding:10px}
  .chat-list-time{display:none}
  .message-row{max-width:90%}
  .composer-chat{grid-template-columns:minmax(0,1fr) auto}
  .composer-chat #voiceBtn{display:none}
}


/* Reference-inspired feed actions, powered by Supabase post_likes and comments. */
.murmur-post-stats{display:flex;justify-content:space-between;gap:12px;padding:9px 2px 7px;color:var(--muted,#667085);font-size:.82rem;border-bottom:1px solid var(--line,#e5e7eb)}
.murmur-post-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:5px 0}
.murmur-post-actions button{min-height:40px;border:0;border-radius:9px;background:transparent;color:var(--text,var(--ink,#17202a));font-weight:650}
.murmur-post-actions button:hover,.murmur-post-actions button:focus-visible{background:var(--surface-soft,#f1f5f4);outline:none}
.murmur-post-actions button.is-liked{color:var(--accent,var(--acc,#0aa981));background:rgba(20,200,160,.1)}
.murmur-post-comments{padding:8px 2px 3px;border-top:1px solid var(--line,#e5e7eb)}
.post-comments-list{display:grid;gap:9px}
.post-comment{padding:8px 10px;border-radius:12px;background:var(--surface-soft,#f5f7f8)}
.post-comment strong{font-size:.88rem}
.post-comment p{margin:3px 0;white-space:pre-wrap;overflow-wrap:anywhere}
.post-comment small{color:var(--muted,#667085);font-size:.72rem}
.post-comment-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;margin-top:10px}
.post-comment-form input{min-width:0;min-height:42px;border:1px solid var(--line,#d5dbe3);border-radius:10px;padding:9px 11px;background:var(--input-bg,#fff);color:inherit}
.post-comment-form .btn{width:auto;min-height:42px}
