/* WEB-073: unified ZESIVO header and low-right assistant on every public page. */
@media (min-width:1001px) {
  .topbar {display:grid;grid-template-columns:minmax(0,1fr) max-content minmax(0,1fr);gap:clamp(10px,1.8vw,27px);padding-inline:clamp(14px,1.65vw,34px)}
  .topbar .brand {min-width:0;justify-self:start}
  .topbar .nav {margin:0;gap:clamp(13px,1.7vw,33px);justify-self:center;white-space:nowrap}
  .topbar .header-actions {margin:0;justify-self:end;gap:clamp(9px,1.4vw,21px)}
  .topbar .header-cta {min-width:0}
}
@media (min-width:1001px) and (max-width:1180px) {
  .topbar .brand-word {font-size:22px}
  .topbar .brand-mark {width:40px;height:40px}
  .topbar .nav {gap:13px}
  .topbar .nav-link {font-size:12px}
  .topbar .header-cta {padding-inline:12px;font-size:11.5px;gap:7px}
  .topbar .header-actions {gap:8px}
}
/* The single launcher is moved from the header to the shared footer DOM;
   fixed positioning keeps it visible on all public pages. */
.nz-chat-launch {position:fixed;right:max(13px,env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));display:flex;flex-direction:column-reverse;align-items:center;justify-content:center;gap:1px;min-width:68px;z-index:271;pointer-events:auto}
/* WEB088: the open panel uses the launcher's vertical space and owns its input area. */
.nz-chat-launch.nz-chat-launch-covered {visibility:hidden;pointer-events:none}
.nz-chat-launcher {width:57px;height:57px}
.nz-chat-nudge {font-size:10px;line-height:13px}
.nz-chat-panel {top:96px;bottom:calc(12px + env(safe-area-inset-bottom));right:clamp(12px,1.25vw,22px);height:auto;max-height:none;min-height:0;width:min(420px,calc(100vw - 24px));transform-origin:bottom right}
.nz-chat-suggestions {display:flex;gap:7px;flex-wrap:wrap;margin:4px 12px 2px;max-height:76px;overflow:visible}
.nz-chat-suggestions[hidden] {display:none}
.nz-chat-suggestion {flex:1 1 auto;min-width:0;max-width:100%;padding:8px 10px;background:linear-gradient(115deg,#062d49,#0a213d);color:#d3faff;border:1px solid rgba(12,202,243,.45);border-radius:12px;font-size:11.5px;text-align:center;line-height:1.3;transition:border-color .15s,background .15s}
.nz-chat-suggestion:hover {border-color:#55efff;background:#0d3453}
.nz-chat-suggestion:focus-visible {outline:2px solid #9cf8ff;outline-offset:2px}
@media (max-width:1000px) {
  .topbar .header-actions {margin-left:auto}
  .nz-chat-panel {top:83px;bottom:calc(9px + env(safe-area-inset-bottom));right:10px;width:min(420px,calc(100vw - 20px));height:auto;max-height:none}
  .nz-chat-launch {right:max(10px,env(safe-area-inset-right));bottom:calc(9px + env(safe-area-inset-bottom));min-width:62px}
  .nz-chat-launcher {width:51px;height:51px}
}
@media (max-width:640px) {
  .nz-chat-panel {top:82px;bottom:calc(8px + env(safe-area-inset-bottom));right:9px;width:calc(100vw - 18px);height:auto;max-height:none}
  .nz-chat-launch {right:max(8px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));min-width:57px}
  .nz-chat-launcher {width:47px;height:47px}
  .nz-chat-nudge {font-size:8.8px}
  .nz-chat-suggestions {margin-inline:9px;gap:5px}
  .nz-chat-suggestion {font-size:11px;padding:7px 8px}
}
@media (max-height:520px) {
  .nz-chat-panel {top:73px;bottom:calc(3px + env(safe-area-inset-bottom));height:auto;max-height:none}
  .nz-chat-launch {bottom:calc(3px + env(safe-area-inset-bottom))}
  .nz-chat-launcher {width:40px;height:40px}
}
@media (prefers-reduced-motion:reduce) {
  .nz-chat-suggestion {transition:none}
}

/* WEB080 · Swap the floating order on pages with "volver arriba".
   Nodo Z takes the lower position and the up-arrow moves to the upper slot.
   This gives the chat a little more vertical room while keeping both controls readable. */
body:has(#contact-back-to-top) .nz-chat-launch{right:max(13px,env(safe-area-inset-right));bottom:max(22px,calc(16px + env(safe-area-inset-bottom,0px)))}
body:has(#contact-back-to-top) .nz-chat-panel{bottom:max(22px,calc(16px + env(safe-area-inset-bottom,0px)))}
body:has(#contact-back-to-top) #contact-back-to-top.contact-back-to-top{right:calc(clamp(18px,2.9vw,46px) - 18px);bottom:calc(102px + env(safe-area-inset-bottom,0px));z-index:270}
@media(max-width:1000px){
 body:has(#contact-back-to-top) .nz-chat-launch{right:max(10px,env(safe-area-inset-right));bottom:max(16px,calc(10px + env(safe-area-inset-bottom,0px)))}
 body:has(#contact-back-to-top) .nz-chat-panel{bottom:max(16px,calc(10px + env(safe-area-inset-bottom,0px)))}
 body:has(#contact-back-to-top) #contact-back-to-top.contact-back-to-top{right:calc(16px - 10px);bottom:calc(91px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:640px){
 body:has(#contact-back-to-top) .nz-chat-launch{right:max(8px,env(safe-area-inset-right));bottom:max(16px,calc(10px + env(safe-area-inset-bottom,0px)))}
 body:has(#contact-back-to-top) .nz-chat-panel{bottom:max(16px,calc(10px + env(safe-area-inset-bottom,0px)))}
 body:has(#contact-back-to-top) #contact-back-to-top.contact-back-to-top{right:21px;bottom:calc(83px + env(safe-area-inset-bottom,0px))}
}
@media(max-height:520px){
 body:has(#contact-back-to-top) .nz-chat-launch{bottom:max(12px,calc(8px + env(safe-area-inset-bottom,0px)))}
 body:has(#contact-back-to-top) .nz-chat-panel{bottom:max(12px,calc(8px + env(safe-area-inset-bottom,0px)))}
 body:has(#contact-back-to-top) #contact-back-to-top.contact-back-to-top{bottom:calc(66px + env(safe-area-inset-bottom,0px))}
}

/* WEB081 · Inicio gains the shared floating Back to top control; reserve its corner on small screens. */
@media(max-width:740px){
 body:has(#contact-back-to-top) .zw-footer:not(.contact-footer){padding-right:94px;text-align:left;align-items:flex-start}
 body:has(#contact-back-to-top) .zw-footer:not(.contact-footer) .zw-footer-links{margin-left:0}
}

/* WEB094 · Chat usability in a short visual viewport, including landscape and
   keyboards which resize the CSS viewport. Scope: public assistant only. */
@media (max-width:1000px){
 .nz-chat-inputbar input{font-size:16px;line-height:1.35;}
 .nz-chat-voice-options select{font-size:16px;min-height:38px;}
 .nz-chat-send,.nz-chat-microphone{min-width:44px;min-height:44px;flex-basis:44px;}
 .nz-chat-head-button{min-width:40px;min-height:40px;flex-basis:40px;}
 .nz-chat-launcher{min-width:44px;min-height:44px;}
}
@media (max-width:370px){
 .nz-chat-head-button{min-width:38px;min-height:38px;flex-basis:38px;}
}
@media (max-height:360px){
 .nz-chat-panel{top:max(5px,env(safe-area-inset-top,0px));bottom:max(4px,env(safe-area-inset-bottom,0px));min-height:0;max-height:none;}
 .nz-chat-head{padding:4px 9px;min-height:42px;gap:7px;}
 .nz-chat-head-avatar{width:34px;height:34px;flex-basis:34px;}
 .nz-chat-head-copy small{display:none;}
 .nz-chat-suggestions{margin-block:2px;gap:4px;}
 .nz-chat-panel:focus-within .nz-chat-suggestions{display:none;}
 .nz-chat-inputbar{margin-top:4px;}
 .nz-chat-disclaimer{margin-block:2px;}
}
/* Extra keyboard-visible compactness without modifying JS or dictation logic. */
@media (max-height:300px){
 .nz-chat-voice-options{margin-top:0;min-height:0;}
 .nz-chat-head-copy span{font-size:10px;}
 .nz-chat-scroll{padding-block:6px;}
}
