/* Scoped visual refinement; existing navigation handlers and visibility stay intact. */
#topbar {
  height:auto!important; min-height:56px!important; max-height:none!important;
  width:max-content; max-width:calc(100vw - 340px); padding:5px!important; gap:8px!important;
  border-radius:20px!important; border:1px solid rgba(255,255,255,.72)!important;
  background:rgba(249,250,252,.91)!important;
  box-shadow:0 5px 20px rgba(17,32,59,.13)!important;
  backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
}
#topbar .topbar-sections {display:flex; align-items:center; gap:4px; min-width:0; flex:1 1 auto;}
#topbar .topbar-utilities {
  display:flex; align-items:center; gap:4px; flex:0 0 auto;
  padding-inline-start:8px; border-inline-start:1px solid rgba(23,43,99,.12);
}
#topbar .topbar-sep {display:none;}
#topbar .topbar-btn,
#topbar .topbar-menu-wrap .topbar-btn {
  min-height:44px!important; height:44px!important; min-width:44px!important;
  padding:0 14px!important; border:0!important; border-radius:14px!important;
  flex-direction:row!important; gap:7px!important; color:#334155!important;
  background:transparent; font-family:inherit; font-weight:700;
  box-shadow:none!important; letter-spacing:0;
  transition:background .16s ease,color .16s ease;
}
#topbar .topbar-btn:hover {background:rgba(23,43,99,.07);}
#topbar .topbar-btn.active {
  background:var(--primary,#172b63)!important; color:#fff!important;
  box-shadow:0 2px 7px rgba(23,43,99,.16)!important;
}
#topbar .tb-label {
  width:auto!important; font-size:12px!important; line-height:1.35!important;
  font-weight:700!important; color:inherit!important;
  overflow:visible!important; text-overflow:clip!important; white-space:nowrap;
}
#topbar .tb-icon,
#topbar #tb-map .tb-icon,
#topbar #tb-panorama .tb-icon,
#topbar .topbar-btn.active .tb-icon {
  display:flex!important; align-items:center; justify-content:center;
  width:18px!important; height:18px!important; flex:0 0 18px!important;
  color:inherit!important; border:0!important; background:none!important;
  border-radius:0!important; box-shadow:none!important;
}
#topbar .tb-icon svg,
#topbar #tb-map .tb-icon svg,
#topbar #tb-panorama .tb-icon svg {
  display:block!important; width:18px!important; height:18px!important;
  color:inherit!important; stroke-width:1.8;
}
#topbar #lang-toggle,
#topbar #tb-fullscreen {
  position:static!important; flex:0 0 44px!important; width:44px!important;
  min-width:44px!important; min-height:44px!important; height:44px!important;
  display:flex; align-items:center; justify-content:center;
  padding:0!important; margin:0!important; border:0!important; border-radius:13px!important;
  background:rgba(23,43,99,.045)!important; color:#334155!important;
  backdrop-filter:none; box-shadow:none!important; font-family:inherit;
}
#topbar #lang-toggle:hover,
#topbar #tb-fullscreen:hover {background:rgba(23,43,99,.10)!important;}
#topbar #lang-label {font:700 12px/1 Inter,sans-serif!important; color:inherit!important; letter-spacing:.2px;}
#topbar #tb-fullscreen .tb-label {
  position:absolute!important; width:1px!important; height:1px!important; padding:0!important;
  margin:-1px!important; overflow:hidden!important; clip-path:inset(50%); white-space:nowrap;
}
#topbar button:focus-visible {outline:2px solid var(--primary,#172b63)!important; outline-offset:2px;}
#topbar .topbar-menu-wrap {flex:0 0 auto;}
@media(min-width:1025px) {
  body #topbar,
  body.panel-open #topbar,
  body.floor-image-fit.panel-open #topbar {
    position:fixed!important; left:50%!important; right:auto!important;
    top:var(--viewer-top-edge,25px)!important; bottom:auto!important;
    transform:translateX(-50%)!important; margin:0!important;
    transition:none!important;
  }
}
@media(min-width:1025px) and (max-width:1440px) {
  /* Keep the fixed toolbar clear of the project panel without moving it. */
  body.panel-open #right-panel {top:92px!important; max-height:calc(100dvh - 104px)!important;}
}
@media(min-width:1025px) and (max-width:1180px) {
  #topbar {max-width:calc(100vw - 300px); gap:6px!important;}
  #topbar .topbar-btn {padding-inline:10px!important;}
}
@media(max-width:1024px) {
  :root {--mobile-nav-height:72px;}
  #topbar {width:auto!important; max-width:none!important; min-height:72px!important; padding:5px!important; gap:6px!important;}
  #topbar .topbar-sections {align-items:stretch; gap:2px;}
  #topbar .topbar-sections>.topbar-btn,
  #topbar .topbar-sections>.topbar-menu-wrap {flex:1 1 0; min-width:0;}
  #topbar .topbar-menu-wrap .topbar-btn {width:100%;}
  #topbar .topbar-btn,
  #topbar .topbar-menu-wrap .topbar-btn {
    height:60px!important; min-height:60px!important; padding:4px 3px!important;
    flex-direction:column!important; gap:4px!important; border-radius:13px!important;
  }
  #topbar .tb-label {
    width:100%!important; max-width:100%; font-size:10.5px!important;
    white-space:normal; line-height:1.22!important; text-align:center;
    overflow-wrap:normal; word-break:normal;
  }
  #topbar .topbar-utilities {gap:3px; padding-inline-start:6px;}
  #topbar .units-dropdown {bottom:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom,8px) + 8px);}
  body:not(.compact-panel-open) #render-nav {bottom:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom,8px) + 8px)!important;}
  body:not(.panorama-mode).compact-panel-open #right-panel {bottom:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom,8px) + 8px)!important;}
}
@media(max-width:359px) {
  :root {--mobile-nav-height:100px;}
  #topbar {left:6px!important; right:6px!important; gap:3px!important; padding:4px!important; min-height:100px!important;}
  #topbar .topbar-sections {align-items:center;}
  #topbar .topbar-utilities {padding-inline-start:4px; gap:2px; flex-direction:column;}
  #topbar .tb-label {font-size:10px!important;}
  html[lang="en"] #topbar .tb-label {font-size:9px!important;}
}
@media(prefers-reduced-motion:reduce) {#topbar button {transition:none!important;}}
