/* QPal QBao header, dashboard topbar, and Admin Access theme update. */

/* Keep only the navigation menu button above the main dashboard card. */
.qpal-navigation-topbar > .qpal-final-dashboard-icon,
.qpal-navigation-topbar > .qpal-navigation-wordmark {
  display: none !important;
}

/* The original QBao labels are removed by final-branding.js. This immediate
   hide prevents a transient label flash before the dialog DOM is adjusted. */
.qbao-heading-copy {
  display: none !important;
}

/* Keep the QBao introduction compact. The mascot sits inside the header and
   ends exactly at the divider without negative margins or line overlap. */
.qbao-header {
  min-height: 86px;
  align-items: stretch;
  gap: 8px;
  padding: 6px 10px 0 6px;
}

.qbao-identity {
  min-height: 79px;
  flex: 1 1 auto;
  align-items: flex-end;
  gap: 6px;
}

.qbao-mascot {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  align-self: flex-end;
  margin: 0;
  object-position: center bottom;
}

.qbao-header-welcome {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  align-self: center;
}

.qbao-header-welcome .qbao-message-bubble {
  max-width: 100%;
  padding: 8px 10px;
}

.qbao-header-welcome .qbao-description {
  font-size: 11px;
  line-height: 1.4;
}

.qbao-header-controls {
  align-self: center;
  margin-top: 0;
}

/* Use QPal's theme-aware orange instead of fixed yellow Admin Access colors. */
.admin-dialog-eyebrow {
  color: var(--accent) !important;
}

.admin-btn-primary {
  color: var(--accent-contrast) !important;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent) !important;
}

.admin-btn-primary:hover,
.admin-btn-primary:focus-visible {
  color: var(--accent-contrast) !important;
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  box-shadow: 0 0 0 4px var(--focus-ring),
    0 9px 24px color-mix(in srgb, var(--accent) 28%, transparent) !important;
}

.outside-control-btn.admin-control.admin-active {
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
  border-color: var(--accent-border) !important;
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-control),
    var(--inner-highlight) !important;
}

.outside-control-btn.admin-control.admin-active:hover,
.outside-control-btn.admin-control.admin-active:focus-visible {
  color: var(--accent-hover) !important;
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--accent)) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px var(--focus-ring), var(--shadow-control),
    var(--inner-highlight) !important;
}

@media (max-width: 560px) {
  .qbao-header {
    min-height: 80px;
    gap: 6px;
    padding: 5px 8px 0 5px;
  }

  .qbao-identity {
    min-height: 74px;
    gap: 4px;
  }

  .qbao-mascot {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
    margin: 0;
  }

  .qbao-header-welcome .qbao-message-bubble {
    padding: 7px 8px;
  }

  .qbao-header-welcome .qbao-description {
    font-size: 11px;
    line-height: 1.35;
  }

  .qbao-header-controls {
    gap: 5px;
  }

  .qbao-remaining-pill {
    min-height: 26px;
    padding: 4px 7px;
  }

  .qbao-close {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
}
