/* Scoped to the Bala Su WhatsApp view. Other pages and the settings dialog keep their layout. */
body.bala-wa-screen{overflow:hidden}
body.bala-wa-screen main{display:flex;flex-direction:column;height:var(--bala-wa-screen-height,100dvh);min-height:0;overflow:hidden}
body.bala-wa-screen .topbar{flex:0 0 auto;min-height:64px;padding:10px 22px;gap:14px}
body.bala-wa-screen .topbar h1{font-size:25px}
body.bala-wa-screen .topbar p{display:none}
body.bala-wa-screen .sidebar{max-height:100dvh;overflow-y:auto}
body.bala-wa-screen #whatsapp.active{display:flex;flex:1 1 0;flex-direction:column;gap:10px;width:100%;max-width:none;min-height:0;min-width:0;margin:0;padding:10px 18px 14px;overflow:hidden;animation:none}
body.bala-wa-screen #whatsapp>.sf-wa-hero{flex:0 0 auto;min-height:46px;padding:7px 12px;gap:10px;border-radius:12px;box-shadow:none;background:#fff;flex-wrap:nowrap}
body.bala-wa-screen #whatsapp .sf-wa-mark,body.bala-wa-screen #whatsapp .sf-wa-copy>.sf-kicker,body.bala-wa-screen #whatsapp .sf-wa-copy>h2,body.bala-wa-screen #sfWaMetrics{display:none}
body.bala-wa-screen #whatsapp .sf-wa-copy{flex:1 1 auto;min-width:0}
body.bala-wa-screen #sfWaSummary{margin:0;max-width:none;font-size:12px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.bala-wa-screen #whatsapp .sf-wa-tools{flex:0 0 auto;width:auto;margin:0;gap:8px;flex-wrap:nowrap}
body.bala-wa-screen #sfWaManageOpen{min-height:32px;padding:6px 11px;font-size:12px}
body.bala-wa-screen #whatsapp>.wa-handoff-panel{flex:0 0 auto;min-height:0;max-height:22vh;padding:10px 14px;margin:0;overflow:auto}
body.bala-wa-screen #whatsapp>.wa-handoff-panel .panel-head{margin-bottom:8px}
body.bala-wa-screen #whatsapp>.wa-handoff-panel h2{font-size:15px}
body.bala-wa-screen #whatsapp>.wa-handoff-panel .panel-head p{display:none}
body.bala-wa-screen #whatsapp .wa-layout{display:grid;flex:1 1 0;min-height:0;min-width:0;grid-template-columns:clamp(260px,25vw,320px) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:12px;margin:0}
body.bala-wa-screen #whatsapp .wa-layout>.panel{min-height:0;min-width:0;margin:0;padding:14px;border-radius:16px;overflow:hidden}
body.bala-wa-screen #whatsapp .wa-inbox{display:grid;grid-template-rows:auto auto auto minmax(0,1fr);gap:8px}
body.bala-wa-screen #whatsapp .wa-inbox>.panel-head{margin:0;gap:8px}
body.bala-wa-screen #whatsapp .wa-inbox h2{margin:0;font-size:17px}
body.bala-wa-screen #waInboxSummary{font-size:11px;margin:3px 0 0}
body.bala-wa-screen #waReload{font-size:12px;padding:5px 0}
body.bala-wa-screen #whatsapp .wa-new-dialog{gap:6px;margin:0}
body.bala-wa-screen #whatsapp .wa-new-dialog select,body.bala-wa-screen #whatsapp .wa-new-dialog button,body.bala-wa-screen #waSearch{width:100%;min-width:0;min-height:36px;height:36px;padding:7px 9px;font-size:12px;border-radius:9px}
body.bala-wa-screen #waThreads{display:flex;flex-direction:column;gap:6px;min-height:0;max-height:none;margin:0;padding-right:3px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
body.bala-wa-screen #waThreads .wa-thread{flex:0 0 auto;min-width:0;padding:9px 10px;border-radius:10px}
body.bala-wa-screen #waThreads .wa-thread-head{display:flex;gap:7px;margin:0;align-items:center}
body.bala-wa-screen #waThreads .wa-thread strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:1.35}
body.bala-wa-screen #waThreads .wa-thread>span:not(.wa-thread-head){margin-top:4px;font-size:12px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.bala-wa-screen #waThreads .wa-thread small{margin-top:4px;font-size:10px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.bala-wa-screen #whatsapp .wa-chat{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:0;min-height:0;max-height:none}
body.bala-wa-screen #whatsapp .wa-chat-head{min-width:0;gap:10px;padding-bottom:10px;align-items:center}
body.bala-wa-screen #whatsapp .wa-chat-head>div{flex:1;min-width:0}
body.bala-wa-screen #waChatTitle{font-size:17px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.bala-wa-screen #waChatSubtitle{font-size:11px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.bala-wa-screen #waMessages{min-height:0;max-height:none;padding:12px 2px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
body.bala-wa-screen #waMessages .empty-state{display:grid;place-items:center;flex:1;min-height:0;font-size:13px}
body.bala-wa-screen #waMessages .wa-message{max-width:85%;min-width:0;padding:9px 12px;font-size:13px;overflow-wrap:anywhere}
body.bala-wa-screen #whatsapp .wa-quick-replies{min-width:0;padding:7px 0;gap:6px}
body.bala-wa-screen #whatsapp .wa-quick-replies button{padding:5px 9px;font-size:11px}
body.bala-wa-screen #waMessageForm{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px;min-width:0;margin:0;padding-top:9px;background:#fff}
body.bala-wa-screen #waMessageInput{height:44px;min-height:44px;max-height:96px;padding:10px 12px;resize:vertical;font-size:13px;line-height:1.5}
body.bala-wa-screen #waMessageForm>button{width:auto;min-height:44px;margin:0;padding:10px 17px;font-size:13px;border-radius:11px}
body.bala-wa-screen #whatsapp .bala-wa-back{display:none}
@media(max-width:760px){
  body.bala-wa-screen .topbar{display:flex;min-height:56px;padding:8px 12px;gap:10px;flex-wrap:nowrap}
  body.bala-wa-screen .topbar>div:nth-child(2){flex:1;min-width:0}
  body.bala-wa-screen .topbar h1{font-size:20px}
  body.bala-wa-screen .top-actions{width:auto;margin:0;gap:6px}
  body.bala-wa-screen .top-actions>span{display:none}
  body.bala-wa-screen #refresh{padding:7px 10px;min-height:34px;font-size:11px}
  body.bala-wa-screen #whatsapp.active{padding:6px 8px max(8px,env(safe-area-inset-bottom));gap:7px}
  body.bala-wa-screen #whatsapp>.sf-wa-hero{min-height:40px;padding:5px 9px}
  body.bala-wa-screen #sfWaSummary{font-size:10px}
  body.bala-wa-screen #whatsapp .sf-wa-tools{gap:5px}
  body.bala-wa-screen #whatsapp .sf-wa-tools .pill{font-size:9px;padding:4px 6px}
  body.bala-wa-screen #sfWaManageOpen{min-height:30px;padding:5px 7px;font-size:11px}
  body.bala-wa-screen #whatsapp .wa-layout{grid-template-columns:minmax(0,1fr);gap:0}
  body.bala-wa-screen #whatsapp .wa-layout>.panel{padding:11px;border-radius:12px}
  body.bala-wa-screen #whatsapp:not(.bala-wa-chat-open) .wa-chat{display:none}
  body.bala-wa-screen #whatsapp.bala-wa-chat-open .wa-inbox{display:none}
  body.bala-wa-screen #whatsapp .bala-wa-back{display:block;flex:none;border:1px solid var(--line,#dce8ee);border-radius:8px;background:#fff;color:#174c70;padding:8px;font:inherit;font-size:11px;font-weight:750;white-space:nowrap}
  body.bala-wa-screen #whatsapp .wa-chat-head{gap:8px}
  body.bala-wa-screen #waChatTitle{font-size:14px}
  body.bala-wa-screen #waChatMode{display:none}
  body.bala-wa-screen #waMessageInput{font-size:16px;resize:none}
  body.bala-wa-screen #waMessageForm>button{padding:10px 12px;font-size:12px}
  body.bala-wa-screen #whatsapp .wa-quick-replies button{font-size:10px}
}
