:root{color-scheme:dark;font-family:system-ui,sans-serif;background:#060e22;color:#e5f4ff}*{box-sizing:border-box}body{margin:0}main{max-width:1200px;margin:auto;padding:20px}h1{font-size:26px;margin:0}h2{font-size:19px;margin:0 0 14px}p{line-height:1.5;overflow-wrap:anywhere;color:#b4c6dd}a{color:#59dfdf}.page-header,.toolbar,.conversation-header{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.page-header #status{font-size:13px;margin-left:auto}.toolbar{margin-top:16px}section,.extra{background:#101e40;border:1px solid #354b78;border-radius:16px;padding:16px;min-width:0}button,input{font:inherit;color:#e5f4ff;background:#1b3960;border:1px solid #4a8dba;border-radius:10px;padding:11px;min-height:44px}button{cursor:pointer}button[aria-pressed=true]{background:#106a68;border-color:#60edda}button:disabled{opacity:.6}input{width:100%;margin:8px 0}label,.muted{font-size:13px}.columns{display:grid;grid-template-columns:minmax(260px,1fr) minmax(0,2fr);gap:16px;margin:16px 0;align-items:start}#chatList,#chatPanel{height:68dvh;min-height:400px;display:flex;flex-direction:column}#chats{overflow:auto;flex:1}.chat-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid #354b78;padding:8px 0}.chat-open{flex:1;min-width:0;text-align:left;overflow-wrap:anywhere}.chat-switch{font-size:12px;width:96px;flex-shrink:0}.chat-row button{border-color:#354b78}#messages{overflow:auto;flex:1;min-height:0;padding:6px 0}.message{white-space:pre-wrap;overflow-wrap:anywhere;border-radius:12px;background:#192b50;margin:10px 0;padding:12px;max-width:92%}.message.mine{background:#204759;margin-left:auto}.message small{display:block;color:#89b3d5;margin-bottom:8px}.extra{margin:16px 0}.extra summary{cursor:pointer;min-height:32px}#qr{max-width:100%;height:auto;background:white}#back{display:none}#chatPolicy{margin:8px 0;font-size:12px}[hidden]{display:none!important}@media(max-width:650px){main{padding:12px}.page-header #status{width:100%;margin:0}.columns{display:block}#chatPanel{display:none}#chatList{height:68dvh;min-height:340px}.conversation-open #chatList,.conversation-open .page-header,.conversation-open>.toolbar,.conversation-open>#detail,.conversation-open>.extra{display:none}.conversation-open #chatPanel{display:flex;height:calc(100dvh - 24px - env(safe-area-inset-bottom));min-height:0}.conversation-open .columns{margin:0}#back{display:block}.conversation-header{flex-wrap:nowrap;align-items:center}.conversation-header h2{margin:0;font-size:17px;overflow-wrap:anywhere}#chatControls button{font-size:13px;margin-top:10px}.chat-switch{width:90px}section{padding:12px}}
.protocol form{display:grid;gap:10px;margin-top:14px}.protocol label{display:block}.protocol input[type=checkbox]{width:auto;margin-right:8px;min-height:auto}.protocol-times{display:grid;grid-template-columns:1fr 1fr;gap:12px}.protocol textarea{display:block;width:100%;font:inherit;color:inherit;background:#09172c;border:1px solid #4a8dba;border-radius:10px;padding:10px;box-sizing:border-box}#chatControls details{margin-bottom:8px}#chatControls details input{margin-top:6px}

/* iPhone keyboard (10.11): an open conversation is a fixed frame that follows the visible
   viewport (whatsapp.js publishes --app-top/--app-height); the document itself cannot scroll, so
   the keyboard no longer pushes the header away or leaves the page shifted. The list view and the
   protocol form keep normal page scrolling (research/tasks share this stylesheet). */
@media(max-width:650px){
 html.wa-chat-open,html.wa-chat-open body{height:100%;overflow:hidden;overscroll-behavior:none}
 html.wa-chat-open body{position:fixed;inset:0;width:100%}
 main.conversation-open{position:fixed;inset:var(--app-top,0px) 0 auto 0;height:100dvh;height:var(--app-height,100dvh);display:flex;flex-direction:column;overflow:hidden;padding:max(10px,env(safe-area-inset-top)) 12px max(10px,env(safe-area-inset-bottom))}
 .conversation-open .columns{flex:1;min-height:0;display:flex;flex-direction:column}
 .conversation-open #chatPanel{flex:1;height:auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
 .conversation-open #messages{min-height:120px}
}

/* iPhone zooms the whole page into any field under 16px and stays zoomed (09.11). */
@media (pointer: coarse) { input, textarea, select { font-size: 16px !important; } }
