/* Base layout — applied when site-chrome.js loads */
html.bmp-site-chrome-active {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

html.bmp-site-chrome-active body {
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
}

.bmp-site-chrome-header {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  box-sizing: border-box;
}

.bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'brand menu'
    'panel panel';
  align-items: center;
  gap: 0.75rem 1rem;
}

.bmp-site-chrome-header--minimal {
  display: flex;
  max-width: 28rem;
  justify-content: center;
  padding-top: 1.25rem;
  padding-bottom: 0.5rem;
}

.bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) .bmp-brand-link {
  grid-area: brand;
  min-width: 0;
}

.bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) .bmp-site-chrome-menu-btn {
  grid-area: menu;
}

.bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) .bmp-site-chrome-panel {
  grid-area: panel;
}

.bmp-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.bmp-brand-link:hover .bmp-brand-text {
  opacity: 0.92;
}

.bmp-brand-text {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(1.05rem, 3.5vw, 1.25rem);
  background: linear-gradient(135deg, #b76dff, #0566d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bmp-brand-beta {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #b76dff, #0566d9);
  color: #fff;
  -webkit-text-fill-color: #fff;
  flex-shrink: 0;
}

.bmp-site-chrome-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bmp-site-chrome-nav--guest {
  gap: 0.75rem;
}

.bmp-site-chrome-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bmp-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.bmp-site-chrome-link:hover {
  color: var(--bmp-text);
}

.bmp-site-chrome-link[aria-current='page'] {
  color: #c4b5fd;
}

.bmp-site-chrome-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bmp-text-muted);
  text-decoration: none;
  border: 1px solid var(--bmp-border);
  padding: 0.45rem 0.75rem;
  border-radius: 9999px;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.bmp-site-chrome-pill:hover {
  border-color: rgba(183, 109, 255, 0.8);
  color: #d1d5db;
}

.bmp-site-chrome-pill--admin {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.4);
}

.bmp-site-chrome-pill[aria-current='page'] {
  border-color: rgba(183, 109, 255, 0.6);
  color: #e9d5ff;
}

.bmp-site-chrome-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #b76dff 0%, #0566d9 100%);
  transition: opacity 0.15s;
  text-align: center;
}

.bmp-site-chrome-cta:hover {
  opacity: 0.88;
}

.bmp-site-chrome-demo {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #b76dff 0%, #0566d9 100%);
  transition: opacity 0.15s;
  text-align: center;
}

.bmp-site-chrome-demo:hover {
  opacity: 0.88;
}

.bmp-site-chrome-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.bmp-site-chrome-meta {
  font-size: 0.75rem;
  color: var(--bmp-text-muted);
}

.bmp-site-chrome-email {
  max-width: min(100%, 14rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bmp-site-chrome-tier {
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #b76dff, #0566d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.bmp-site-chrome-logout {
  font-size: 0.75rem;
  color: var(--bmp-text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.35rem 0.25rem;
  min-height: 2.75rem;
}

.bmp-site-chrome-logout:hover {
  color: var(--bmp-text);
}

.bmp-site-chrome-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--bmp-border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--bmp-text);
  cursor: pointer;
  flex-shrink: 0;
}

.bmp-site-chrome-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.bmp-site-footer {
  border-top: 1px solid var(--bmp-border);
  padding: 1.75rem 1rem;
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  margin-top: auto;
  box-sizing: border-box;
}

.bmp-site-footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.bmp-site-footer-brand {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
}

.bmp-site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
  max-width: 100%;
}

.bmp-site-footer-nav a,
.bmp-site-footer-link {
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
  padding: 0.2rem 0.1rem;
}

.bmp-site-footer-nav a:hover,
.bmp-site-footer-link:hover {
  color: #cbd5e1;
}

.bmp-site-footer-nav a[aria-current='page'],
.bmp-site-footer-link[aria-current='page'] {
  color: #94a3b8;
}

.bmp-site-footer-copy {
  font-size: 0.75rem;
  color: #475569;
  margin: 0;
  line-height: 1.5;
  max-width: 36rem;
}

/* Tablet / mobile — collapsible nav */
@media (max-width: 991px) {
  .bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) .bmp-site-chrome-menu-btn {
    display: inline-flex;
  }

  .bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) .bmp-site-chrome-panel {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bmp-border);
  }

  .bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal).bmp-site-chrome-header--open .bmp-site-chrome-panel {
    display: flex;
  }

  .bmp-site-chrome-nav,
  .bmp-site-chrome-nav--guest {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }

  .bmp-site-chrome-panel .bmp-site-chrome-link,
  .bmp-site-chrome-panel .bmp-site-chrome-pill,
  .bmp-site-chrome-panel .bmp-site-chrome-cta,
  .bmp-site-chrome-panel .bmp-site-chrome-demo {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  .bmp-site-chrome-account {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.35rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--bmp-border);
  }

  .bmp-site-chrome-email {
    max-width: 100%;
  }

  .bmp-site-chrome-account .bmp-site-chrome-meta:nth-child(2) {
    display: none;
  }
}

/* Desktop — inline nav */
@media (min-width: 992px) {
  .bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
  }

  .bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) .bmp-site-chrome-panel {
    display: flex !important;
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-end;
    border-top: 0;
    padding-top: 0;
  }
}

@media (max-width: 480px) {
  .bmp-site-chrome-header:not(.bmp-site-chrome-header--minimal) {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .bmp-site-footer {
    padding-top: 1.5rem;
  }

  .bmp-site-footer-nav {
    gap: 0.5rem 0.75rem;
  }

  .bmp-site-footer-nav a,
  .bmp-site-footer-link {
    font-size: 0.8125rem;
  }
}
