:root{font-family:system-ui,-apple-system,sans-serif;color:#493d37;background:#fffaf5}*{box-sizing:border-box}body{margin:0}main{max-width:720px;margin:auto;padding:20px 16px 60px}header{padding:18px 4px}header small{color:#9374a3;font-weight:800}h1{font-size:1.7rem;margin:8px 0}header p{color:#766c65}.notice{background:#fff0d8;border-radius:14px;padding:14px;font-size:.9rem;line-height:1.5}nav{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:18px 0}button{border:1px solid #d9c9d8;border-radius:12px;background:white;padding:12px 8px;color:#493d37;font-weight:700;cursor:pointer}nav button{font-size:.8rem}button.active,.primary{background:#75548b;color:white;border-color:#75548b}.view{background:white;border:1px solid #eee2e6;border-radius:18px;padding:18px}.hidden{display:none}h2{margin-top:0;font-size:1.2rem}label{display:block;font-weight:650;margin:14px 0}input,textarea{display:block;width:100%;margin-top:7px;padding:12px;border:1px solid #d5cbd0;border-radius:10px;font:inherit}form>.primary{width:100%;margin-top:10px}.item{border:1px solid #eee2e6;border-radius:12px;padding:14px;margin:12px 0;overflow-wrap:anywhere}.item h3{margin:0 0 8px}.muted{color:#756d70;font-size:.88rem}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.actions button{flex:1;min-width:140px}.state{font-size:.85rem;margin-top:10px}a{color:#75548b}footer{margin-top:25px;text-align:center;color:#80747a;font-size:.75rem}@media(max-width:370px){nav{grid-template-columns:repeat(2,1fr)}}
/* AI secretary: mobile-first conversation shell */
.chat-history{height:min(48vh,430px);min-height:210px;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:12px 4px;margin:12px 0;border-top:1px solid #eee2e6;border-bottom:1px solid #eee2e6;scroll-behavior:smooth}
.chat-message{max-width:88%;border-radius:16px;padding:11px 14px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}
.chat-message.user{align-self:flex-end;background:#eee3f3}
.chat-message.assistant{align-self:flex-start;background:#fff0dc}
.chat-message.system{align-self:center;background:#f6f1f0;color:#71656b;font-size:.85rem}
#chat-form{display:grid;gap:9px}#chat-form label{margin:0}#chat-form textarea{margin:0;resize:vertical}button:disabled,textarea:disabled{opacity:.6;cursor:not-allowed}details{margin-top:18px;border-top:1px solid #eee2e6;padding-top:14px}summary{cursor:pointer;font-weight:700}

/* Compact deployment identity beside studio brand */
.studio-brand{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.studio-version{font-size:.69rem;font-weight:750;letter-spacing:.02em;color:#75548b;background:#f0e6f5;border:1px solid #e4d5ec;padding:3px 8px;border-radius:999px;font-variant-numeric:tabular-nums}

/* Headquarters renewal: preserve existing functional DOM, only change its layout. */
main{max-width:1480px;padding:20px 22px 60px}
.hq-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start}
.hq-space{min-width:0;border:1px solid #eee2e6;background:#fffdfc;border-radius:20px;padding:18px}
.studio-space{background:#faf5ff}
.representative-space{background:#fffaf7}
.space-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.space-heading h2{margin:0}
.space-heading button{flex-shrink:0}
.studio-desk{border:1px solid #ded0e9;background:white;padding:16px;border-radius:16px;margin-top:16px}
.studio-desk h3{margin-top:0}
.studio-departments .item{background:white}
.representative-space nav{grid-template-columns:repeat(3,minmax(0,1fr))}
.representative-space .view{padding:16px}
.future-workspaces{margin-top:18px}
.mobile-space-tabs{display:none}
.hq-layout.focus-studio{grid-template-columns:minmax(0,1fr)}
.hq-layout.focus-studio .representative-space{display:none}
.hq-layout.focus-representative{grid-template-columns:minmax(0,1fr)}
.hq-layout.focus-representative .studio-space{display:none}
@media(max-width:760px){
 main{padding:14px 12px 48px}
 .mobile-space-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
 .mobile-space-tabs [aria-pressed="true"]{background:#75548b;color:white}
 .hq-layout,.hq-layout.focus-studio,.hq-layout.focus-representative{display:block}
 .hq-space{padding:14px}
 .hq-layout.mobile-studio .representative-space{display:none}
 .hq-layout.mobile-representative .studio-space{display:none}
 .representative-space nav{grid-template-columns:repeat(2,minmax(0,1fr))}
 .space-heading .focus-button{display:none}
}

/* Mobile selection always wins over desktop focus state when resizing. */
@media(max-width:760px){
 .hq-layout.mobile-studio .studio-space{display:block}
 .hq-layout.mobile-studio .representative-space{display:none}
 .hq-layout.mobile-representative .representative-space{display:block}
 .hq-layout.mobile-representative .studio-space{display:none}
}
