/* Chat-first layout. Secondary controls remain available behind Tools. */
#home .dashboard{grid-template-columns:minmax(0,1fr)}
#home .rightcol{display:none}
#home .quick,#home .af-mobile-entry{display:none}
body.mai-tools-open #home .quick{display:flex}
body.mai-tools-open #home .af-mobile-entry{display:block}
.mai-tools-toggle{align-self:flex-start;margin:2px 12px 5px;padding:5px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--muted);font-size:12px;cursor:pointer;flex-shrink:0}
#home .chat{overflow:hidden}
#home .messages{flex:1;min-height:0;overflow:auto}
#home .usage-strip{padding:4px 8px;gap:4px}
#home .usage-compact{height:30px;border:0;padding:0 5px;border-radius:6px}
#home .usage-compact strong{font-size:12px}
#home .usage-compact span{font-size:9px}
#home .module-select-wrap{height:28px;margin:0;border-radius:8px;box-shadow:none}
#home .module-select{padding:3px 0;font-size:12px}
.mai-setup{width:min(480px,calc(100% - 24px));max-height:85dvh;overflow:auto;border:1px solid var(--line);border-radius:20px;padding:24px;background:var(--surface,#fff);color:var(--text,#17243b)}
.mai-setup::backdrop{background:#10203088}
.mai-setup h2{font-size:21px;line-height:1.35}
.mai-setup p,.mai-setup small{line-height:1.5}
.mai-setup label{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;margin:12px 0;font-size:14px}
.mai-setup textarea,.mai-setup select{width:100%;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font:inherit}
.mai-setup input[type=checkbox]{width:20px;height:20px}
.mai-setup-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:18px}
.mai-setup-actions button{padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);cursor:pointer}
.mai-setup-actions .primary{background:#176bff;color:white}
@media(max-width:700px){
 .main{padding:0 0 calc(56px + env(safe-area-inset-bottom))!important}
 #home .chat{height:calc(var(--mai-vvh,100dvh) - 56px - env(safe-area-inset-bottom));min-height:0;border-radius:0;border:0}
 #home .chat-head{padding:5px 9px}
 #home .who small{display:none}
 #home .usage-strip{display:grid;grid-template-columns:1fr 1fr 1fr}
 #home .module-select-wrap{display:none}
 body.mai-tools-open #home .module-select-wrap{display:flex}
 #home .composer{margin:0 6px 5px;padding:6px;gap:5px;grid-template-columns:34px 34px minmax(0,1fr) 40px}
 #home .composer textarea{min-width:0;font-size:16px;padding:8px 2px}
 #home .composer .attach,#home .composer .voice-input{width:34px;height:38px}
 #home .messages{padding:10px}
 #home .msg{font-size:14px;max-width:94%}
 .mobile-bottom{height:56px;padding:5px 3px}
 .mobile-bottom .create{height:36px;width:36px;margin:-6px auto 0;font-size:23px}
 body.mai-keyboard-open #home .chat{height:var(--mai-vvh,100dvh)}
 body.mai-keyboard-open .mobile-bottom{display:none}
 body.mai-keyboard-open .main{padding-bottom:0!important}
}
