.interface-mode-button { white-space:nowrap; }
header.topbar .interface-mode-button, header.topbar #web-assistant-open { width:auto; min-width:95px; padding:0 10px; border-radius:4px; }
#portal-navigation-dialog { min-width:0; max-width:min(480px,94vw); border:1px solid #aeb8be; border-radius:6px; padding:24px; background:#fff; color:#203847; }
#portal-navigation-dialog button { margin:8px 10px 0 0; padding:8px 12px; cursor:pointer; }
#interface-mode-dialog { min-width:0; max-width:520px; width:calc(100vw - 40px); box-sizing:border-box; border:1px solid var(--border); border-radius:6px; padding:22px; color:var(--text); background:var(--panel,#fff); }
#interface-mode-form > label { display:block; margin:18px 0; }
#interface-mode-form input { width:auto; margin-right:8px; }
#interface-mode-form p { font-size:13px; }
.interface-dialog-actions { display:flex; justify-content:flex-end; gap:10px; }
#interface-mode-error { color:#b42318; }
#web-assistant { position:fixed; right:0; top:var(--header-h,65px); bottom:0; width:min(500px,100vw); z-index:900; background:#fff; border-left:1px solid var(--border); box-shadow:-4px 0 16px #0002; display:flex; flex-direction:column; }
#web-assistant[hidden] { display:none; }
.web-assistant-heading { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; border-bottom:1px solid var(--border); }
.web-assistant-heading button { cursor:pointer; }
#web-assistant iframe { width:100%; flex:1; border:0; min-height:0; }
body.embedded #web-assistant, body.embedded #interface-mode-dialog { display:none; }
body.web-assistant-visible > main { margin-right:min(500px,45vw); }
@media(max-width:900px) { body.web-assistant-visible > main { margin-right:0; } .interface-mode-button { max-width:130px; overflow:hidden; text-overflow:ellipsis; } }
@media(max-width:800px) {
  html[data-theme] { --header-h:144px; }
  html[data-theme]:has(#wb:not(.assistant-only)) { --header-h:88px; }
  header.topbar { flex-wrap:wrap; align-content:center; padding:6px 10px; gap:6px; }
  header.topbar .brand { flex:1 0 calc(100% - 140px); min-width:0; font-size:16px; }
  header.topbar .spacer { display:none; }
  header.topbar .user { max-width:70px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  nav.topnav { order:10; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; height:56px; margin:0; }
  nav.topnav .dd-label { width:100%; padding:0 6px; justify-content:center; font-size:12px; }
  nav.topnav .dd:nth-child(3n) .dd-menu { left:auto; right:0; }
}
@media print { #web-assistant, #interface-mode-dialog { display:none !important; } body.web-assistant-visible > main { margin-right:0; } }
