#v0373ChatPanel .panel-content{max-width:960px;padding-bottom:calc(28px + env(safe-area-inset-bottom))}
#v0373ChatPanel .chat-wrap{min-height:calc(100dvh - 112px)}
.v0373-chat-tools{display:flex;gap:8px;align-items:center}
.v0373-recipient{max-width:210px;height:38px;border:1px solid var(--line);background:var(--panel2);color:var(--text);border-radius:11px;padding:0 10px;font-size:12px}
.v0373-chat-status{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--muted)}
.v0373-chat-status i{width:6px;height:6px;border-radius:50%;background:var(--good);box-shadow:0 0 10px color-mix(in srgb,var(--good) 65%,transparent)}
.v0373-chat-status.fallback i{background:var(--warn);box-shadow:none}
.v0373-private{font-size:8px;font-weight:950;letter-spacing:.08em;color:var(--secondary);margin-left:4px}
.v0373-chat-empty{padding:32px 16px;text-align:center;color:var(--muted);font-size:13px}
.v0373-chat-off{display:none!important}
.bottomnav.v0373-chat-disabled{grid-template-columns:repeat(3,1fr)!important}
html.v0380-chat-disabled-global [data-tab="chat"]{display:none!important}
html.v0380-chat-disabled-global .bottomnav{grid-template-columns:repeat(3,1fr)!important}
.v0373-chat-control{margin-top:12px}
.v0373-chat-control .more-row>span:last-child{font-size:10px;font-weight:900;color:var(--secondary)}
.v0373-poll-options{display:grid;gap:7px}
.v0373-poll-options input{width:100%;border:1px solid var(--line);background:#0c1019;color:#fff;border-radius:11px;padding:11px;font-size:16px}
.v0373-send-error{padding:8px 12px;color:var(--bad);font-size:11px}
@media(max-width:799px){
  #v0373ChatPanel .panel-content{padding:10px 10px calc(18px + env(safe-area-inset-bottom))}
  #v0373ChatPanel .chat-wrap{min-height:calc(100dvh - 82px)}
  #v0373ChatPanel .chat-head{align-items:flex-start;gap:10px}
  .v0373-chat-tools{flex-direction:column;align-items:flex-end}
  .v0373-recipient{max-width:165px;font-size:13px}
  #v0373ChatPanel .chat-messages{max-height:none;min-height:calc(100dvh - 300px)}
}


/* v0.3.75 fixed chat shell + keyboard-safe composer */
#v0373ChatPanel{
  overflow:hidden!important;
  padding-bottom:0!important;
  top:var(--v0375-visual-top,0px)!important;
  bottom:auto!important;
  height:var(--v0375-visual-height,100dvh)!important;
  max-height:var(--v0375-visual-height,100dvh)!important;
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
}
#v0373ChatPanel .panel-top{
  position:relative!important;
  top:auto!important;
  flex:0 0 auto!important;
}
#v0373ChatPanel .panel-content{
  width:100%!important;
  max-width:960px!important;
  min-height:0!important;
  height:100%!important;
  overflow:hidden!important;
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
}
#v0373ChatPanel .week-head{
  min-height:0!important;
  margin-bottom:8px!important;
}
#v0373ChatPanel .chat-wrap{
  min-height:0!important;
  height:100%!important;
  max-height:100%!important;
  grid-template-rows:auto minmax(0,1fr) auto!important;
  overflow:hidden!important;
}
#v0373ChatPanel .chat-messages{
  min-height:0!important;
  height:100%!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch;
}
#v0373ChatPanel .composer{
  position:relative!important;
  bottom:auto!important;
  z-index:5!important;
  flex:0 0 auto!important;
  background:var(--panel)!important;
  padding-bottom:max(10px,env(safe-area-inset-bottom))!important;
}
#v0373ChatPanel #v0373Input{
  max-height:96px!important;
}
#v0373ChatPanel #v0375Send:disabled{
  opacity:.55!important;
  cursor:wait!important;
}

@media(max-width:799px){
  #v0373ChatPanel .panel-content{
    padding:8px 10px 0!important;
    grid-template-rows:auto minmax(0,1fr)!important;
  }
  #v0373ChatPanel .week-head{
    padding:0 2px!important;
    margin-bottom:7px!important;
  }
  #v0373ChatPanel .week-head h1{
    font-size:26px!important;
  }
  #v0373ChatPanel .week-head p{
    margin-top:3px!important;
  }
  #v0373ChatPanel .chat-wrap{
    border-radius:18px 18px 0 0!important;
    border-bottom:0!important;
  }
  #v0373ChatPanel .chat-head{
    padding:10px 12px!important;
    flex:0 0 auto!important;
  }
  #v0373ChatPanel .chat-messages{
    padding:10px 12px!important;
  }
  #v0373ChatPanel .composer{
    padding:8px 8px max(8px,env(safe-area-inset-bottom))!important;
    gap:6px!important;
  }
}

/* v0.3.82 Chat behaves like a normal tab while preserving keyboard-safe layout */
#v0373ChatPanel.v0382-chat-tab{
  position:fixed!important;
  top:var(--v0382-frame-top,72px)!important;
  left:var(--v0382-frame-left,0px)!important;
  right:auto!important;
  bottom:auto!important;
  z-index:25!important;
  width:var(--v0382-frame-width,100vw)!important;
  min-width:0!important;
  height:var(--v0382-frame-height,calc(100dvh - 150px))!important;
  max-height:var(--v0382-frame-height,calc(100dvh - 150px))!important;
  grid-template-rows:minmax(0,1fr)!important;
  background:var(--bg)!important;
}
#v0373ChatPanel.v0382-chat-tab .panel-content{
  padding:10px 10px 0!important;
  max-width:960px!important;
  margin:0 auto!important;
  grid-template-rows:auto minmax(0,1fr)!important;
}
#v0373ChatPanel.v0382-chat-tab .chat-wrap{
  min-height:0!important;
  height:100%!important;
  max-height:100%!important;
}
#v0373ChatPanel.v0382-chat-tab .composer{
  padding-bottom:max(8px,env(safe-area-inset-bottom))!important;
}
@media(max-width:799px){
  #v0373ChatPanel.v0382-chat-tab .panel-content{padding:8px 10px 0!important}
  #v0373ChatPanel.v0382-chat-tab .chat-wrap{
    border-radius:18px!important;
    border-bottom:1px solid var(--line)!important;
  }
}
