/* App shell: top bar + content layout. This is the foundation slice of the UI
   restructure; it relocates brand/theme/profile out of the sidebar and lets the
   content column fill the viewport below a fixed-height bar. */

:root {
  --topbar-h: 60px;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--panel-border);
  position: relative;
  z-index: 12;
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  margin-right: 4px;
  min-width: 0;
}

.topbar-logo {
  width: auto;
  height: 26px;
}

.topbar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
}

.topbar-name {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-tagline {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.015em;
  margin-top: 1px;
  white-space: nowrap;
}

.topbar-user-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-btn {
  width: auto;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  gap: 7px;
  display: inline-flex;
  align-items: center;
}

.topbar .header-icon-btn.account-btn {
  height: 34px;
  min-height: 0;
  padding: 0 10px;
}

.topbar-cities {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  padding: 6px 11px;
  border-radius: 8px;
}

.topbar-cities:disabled {
  cursor: default;
  opacity: 0.75;
}

.topbar-cities .header-icon {
  width: 16px;
  height: 16px;
}

.topbar .theme-icon-btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
}

.topbar .btn {
  box-shadow: none;
}

.topbar .btn:hover {
  box-shadow: none;
}

.app-shell {
  height: calc(100vh - var(--topbar-h));
}

/* Account/profile popup: the profile action now lives in the top bar, so the
   popup anchors to it instead of the old sidebar location. */
.dropdown-panel {
  position: fixed;
  left: auto;
  right: 12px;
  top: calc(var(--topbar-h) + 6px);
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - var(--topbar-h) - 18px);
}

@media (max-width: 900px) {
  .dropdown-panel {
    left: 8px;
    right: 8px;
    width: auto;
    top: calc(var(--topbar-h) + 8px + env(safe-area-inset-top));
    max-height: calc(100dvh - var(--topbar-h) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .topbar-tagline {
    display: none;
  }
}

@media (max-width: 960px) and (orientation: portrait) {
  /* The top bar is hidden in portrait, so the shell/map fill the viewport down
     to the tab bar only. */
  .app-shell {
    height: calc(100dvh - var(--tabbar-h, 0px));
  }

  .map-stage {
    height: calc(100dvh - var(--tabbar-h, 0px));
    min-height: 0;
  }

  .topbar-user-label {
    max-width: 96px;
  }
}

@media (max-width: 760px) {
  .topbar-tagline {
    display: none;
  }
}

@media (max-width: 430px) {
  .topbar-cities-label {
    display: none;
  }
}
