:root {
  --cdf-header-height: 72px;
  --cdf-header-bg: #fff;
}



html,
body {
  height: 100%;
  margin: 0;
}

body.cdf-header-active {
  overflow: hidden;
  /* Make the app's 100vh-based layout account for the header. */
  --vh: calc((100vh - var(--cdf-header-height)) / 100);
}

#cdf-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: var(--cdf-header-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--cdf-header-bg);
  color: #3B5579;
  z-index: 2000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#cdf-header .cdf-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
}

#cdf-header .title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#cdf-header .spacer {
  flex: 1 1 auto;
}

#cdf-header .download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #3B5579;
  border-radius: 6px;
  background: #fff;
  color: #3B5579;
  cursor: pointer;
  padding: 0;
}

#cdf-header .download-btn:hover,
#cdf-header .download-btn:focus {
  background: #eef3f8;
  outline: none;
}

#cdf-header .download-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#cdf-download-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 28, 38, 0.45);
  z-index: 3000;
}

#cdf-download-modal.is-open {
  display: flex;
}

#cdf-download-modal .cdf-download-card {
  position: relative;
  width: min(460px, 100%);
  padding: 26px 28px 28px;
  background: #fff;
  color: #24364f;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  text-align: left;
}

#cdf-download-modal .cdf-download-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid #c7d0dc;
  border-radius: 6px;
  background: #fff;
  color: #24364f;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

#cdf-download-modal .engea-modal-logo {
  height: 44px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  margin-bottom: 14px;
}

#cdf-download-modal h2 {
  margin: 0 34px 10px 0;
  font-size: 20px;
  line-height: 1.2;
  color: #24364f;
}

#cdf-download-modal p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.45;
  color: #334760;
}

#cdf-download-modal a {
  color: #0f6b3b;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.cdf-header-active #app {
  height: calc(100vh - var(--cdf-header-height)) !important;
  margin-top: var(--cdf-header-height);
}

body.cdf-header-active .visible-container {
  top: var(--cdf-header-height) !important;
  height: calc(100vh - var(--cdf-header-height)) !important;
}

/* Ensure the login logo stays visible on dark backgrounds. */
img[src*="image_logo"],
img[src*="text_logo_dark"],
img[src*="text_logo"] {
  background-color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}

/* Fallback for inline SVG logos used in the login dialog. */
.login-dialog .logo,
.login-dialog .logo img,
.login-dialog .logo svg,
svg.logo,
img.logo,
.logo svg,
.logo img {
  background-color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}

/* Scoped selector for the LoginDialog component (data-v-a4ec9afa). */
.login-dialog[data-v-a4ec9afa] .logo[data-v-a4ec9afa] {
  background-color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}

/* Replace the header SVG logo (data-v-94d47bc8) with the same image logo. */
.header[data-v-94d47bc8] .logo[data-v-94d47bc8] {
  background-color: #fff;
  background-image: url('/media/LOGO_ENGEA.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  padding: 10px 16px;
  border-radius: 8px;
}

.header[data-v-94d47bc8] .logo[data-v-94d47bc8] path {
  fill: transparent !important;
}

@media (max-width: 600px) {
  :root {
    --cdf-header-height: 64px;
  }

  #cdf-header {
    padding: 0 10px;
  }

  #cdf-header .cdf-logo {
    height: 48px;
  }

  #cdf-header .title {
    font-size: 14px;
  }
}

/* ENGEA branding restore (from original backup behavior) */
img[src*="/map/img/text_logo"],
img[src*="/map/img/text_logo_dark"],
img[src*="text_logo"],
img[src*="image_logo"] {
  content: url('/media/LOGO_ENGEA.png') !important;
  height: 42px !important;
  width: auto !important;
  max-width: none !important;
  background: #fff !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
}

/* Login logo fallback when GISQUICK renders SVG/container logos */
.login-dialog .logo,
.login-dialog .logo img,
.login-dialog .logo svg,
.login-dialog[data-v-a4ec9afa] .logo[data-v-a4ec9afa],
.header[data-v-94d47bc8] .logo[data-v-94d47bc8],
svg.logo,
img.logo,
.logo svg,
.logo img {
  background-image: url('/media/LOGO_ENGEA.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: calc(100% - 20px) auto !important;
  background-color: #fff !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
}

.header[data-v-94d47bc8] .logo[data-v-94d47bc8] path {
  fill: transparent !important;
}

/* Footer/logo chip in map view */
.bottom-toolbar .logo {
  width: 288px !important;
  min-width: 288px !important;
  height: 32px !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  background: #fff !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  text-align: center !important;
  overflow: hidden !important;
}

.bottom-toolbar .logo img,
.bottom-toolbar img[src*="logo"],
.bottom-toolbar img[src*="text_logo"],
.bottom-toolbar img[src*="image_logo"] {
  content: normal !important;
  height: 100% !important;
  width: auto !important;
  max-width: 260px !important;
  background: transparent !important;
  padding: 0 !important;
  object-fit: contain !important;
  vertical-align: top !important;
}

/* Project list/editor topbars */
body > .header .logo,
#app > .header .logo,
.app-header .logo,
.project-header .logo,
.top-bar .logo,
img.logo[src*="text_logo"],
img.logo[src*="image_logo"] {
  content: url('/media/LOGO_ENGEA.png') !important;
  height: 42px !important;
  width: auto !important;
  max-width: 260px !important;
  object-fit: contain !important;
  background: #fff !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  box-sizing: content-box !important;
}

/* Public welcome page branding */
.page .header svg.my-2,
.page .header-small svg.my-2,
.page .header svg[viewBox="0 0 750 100"],
.page .header-small svg[viewBox="0 0 750 100"] {
  width: min(390px, 80vw) !important;
  height: 80px !important;
  max-height: 80px !important;
  background-color: #fff !important;
  background-image: url('/media/LOGO_ENGEA.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: min(320px, calc(100% - 48px)) auto !important;
  border-radius: 6px !important;
  color: transparent !important;
}

.page .header svg.my-2 path,
.page .header-small svg.my-2 path,
.page .header svg[viewBox="0 0 750 100"] path,
.page .header-small svg[viewBox="0 0 750 100"] path {
  opacity: 0 !important;
}

.page .header[data-v-94d47bc8] .logo[data-v-94d47bc8],
.page .header-small[data-v-94d47bc8] .logo[data-v-94d47bc8] {
  display: inline-block !important;
  width: min(390px, 80vw) !important;
  height: 80px !important;
  max-height: 80px !important;
  max-width: min(390px, 80vw) !important;
  background-color: #fff !important;
  background-image: url('/media/LOGO_ENGEA.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: min(320px, calc(100% - 48px)) auto !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  border-radius: 6px !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

.page .header[data-v-94d47bc8] .logo[data-v-94d47bc8] img,
.page .header[data-v-94d47bc8] .logo[data-v-94d47bc8] svg,
.page .header-small[data-v-94d47bc8] .logo[data-v-94d47bc8] img,
.page .header-small[data-v-94d47bc8] .logo[data-v-94d47bc8] svg {
  opacity: 0 !important;
}

/* Login page: keep the decorative logo from filling the right side. */
.login-dialog .bg-logo[data-v-a4ec9afa] {
  background-image: url('/media/LOGO_ENGEA.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: min(320px, calc(100% - 48px)) auto !important;
  background-color: #fff !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  max-width: 34vw !important;
}

.login-dialog .content .logo img,
.login-dialog .content img[src*="logo"],
.login-dialog img[src*="/map/img/text_logo"],
.login-dialog img[src*="/map/img/text_logo_dark"],
.login-dialog img[src*="/map/img/image_logo"] {
  content: url('/media/LOGO_ENGEA.png') !important;
  height: 48px !important;
  width: auto !important;
  max-width: 260px !important;
  object-fit: contain !important;
  background: #fff !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
}

@media (max-width: 760px) {
  .login-dialog .bg-logo[data-v-a4ec9afa] {
    display: none !important;
  }

  .bottom-toolbar .logo {
    width: 170px !important;
  }
}
