:root {
  color-scheme: light;
  --bah-black: #000000;
  --bah-white: #ffffff;
  --bah-primary: #00838f;
  --bah-accent: #23d2d7;
  --text: var(--bah-black);
  --text-muted: rgba(0, 0, 0, 0.72);
  --text-subtle: rgba(0, 0, 0, 0.54);
  --line: rgba(0, 0, 0, 0.12);
  --line-strong: rgba(0, 0, 0, 0.2);
  --accent-soft: rgba(35, 210, 215, 0.12);
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--bah-white);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
}

.shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 72px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.masthead-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}

.brand-lockup {
  display: grid;
  gap: 4px;
}

.brand-chip {
  color: var(--bah-black);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.global-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.global-nav a {
  color: var(--bah-black);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.global-nav a:hover {
  color: var(--bah-primary);
}

.auth-dock {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.auth-pill-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.session-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(35, 210, 215, 0.08);
}

.session-pill-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--bah-black);
  color: var(--bah-white);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.session-menu-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.session-menu-button:hover,
.session-menu-button[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.06);
}

.session-menu-line {
  width: 14px;
  height: 1.5px;
  border-radius: 999px;
  background: var(--bah-black);
}

.session-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bah-white);
  box-shadow: var(--shadow);
  z-index: 10;
}

.session-menu-name,
.session-menu-meta {
  margin: 0;
}

.session-menu-name {
  color: var(--bah-black);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.session-menu-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.session-menu-action {
  width: 100%;
  margin-top: 12px;
  min-height: 40px;
}

.masthead-note,
.eyebrow,
.section-note,
.app-kicker,
.app-domain-chip {
  margin: 0;
  color: var(--bah-primary);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-note,
.app-description,
.message,
.noscript,
.support-band p,
.section-note {
  color: var(--text-muted);
}

h2,
h3 {
  margin-top: 0;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1.04;
}

h3 {
  margin: 6px 0 0;
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bah-white);
  box-shadow: var(--shadow);
}

.message {
  margin: 24px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--bah-primary);
  background: var(--accent-soft);
}

.message-info {
  border-color: var(--bah-primary);
}

.message-error {
  border-color: var(--bah-black);
  background: rgba(0, 0, 0, 0.06);
  color: var(--bah-black);
}

.hidden {
  display: none !important;
}

.primary-button,
.secondary-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--bah-black);
  color: var(--bah-white);
  background: var(--bah-black);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--bah-black);
  background: var(--bah-white);
}

.portal-shell {
  display: grid;
  gap: 18px;
  padding-top: 12px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  gap: 18px;
  max-width: 980px;
}

.app-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  min-height: 0;
  border-radius: 16px;
  border-top: 3px solid var(--bah-black);
  animation: rise-in 0.46s ease both;
  animation-delay: var(--card-delay, 0ms);
}

.app-card-header {
  display: grid;
  gap: 12px;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid rgba(35, 210, 215, 0.34);
  background:
    linear-gradient(135deg, rgba(35, 210, 215, 0.2) 0%, rgba(35, 210, 215, 0) 48%),
    var(--bah-black);
  color: var(--bah-white);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.app-title-group {
  display: grid;
  gap: 8px;
}

.app-title-group h3 {
  margin: 0;
  color: var(--bah-black);
}

.app-description {
  margin: 0;
  line-height: 1.65;
}

.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  flex-wrap: wrap;
}

.app-domain-chip {
  overflow-wrap: anywhere;
}

.app-link {
  color: var(--bah-black);
  font-weight: 700;
  text-decoration: none;
}

.app-link::after,
.secondary-link::after {
  content: "\2192";
  margin-left: 10px;
  color: var(--bah-accent);
}

.app-link.is-disabled {
  color: var(--text-subtle);
}

.app-link.is-disabled::after {
  content: "";
  margin-left: 0;
}

.upload-nav {
  position: relative;
  display: inline-flex;
}

.upload-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bah-black);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.upload-nav-button:hover {
  color: var(--bah-primary);
}

.upload-nav-caret {
  font-size: 0.7rem;
  color: var(--bah-accent);
}

.upload-popover {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 48px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bah-white);
  box-shadow: var(--shadow);
  z-index: 20;
}

.upload-popover-title {
  margin: 0 0 12px;
  color: var(--bah-black);
  font-size: 0.96rem;
  font-weight: 700;
}

.upload-dropzone {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 22px 16px;
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--accent-soft);
  cursor: pointer;
  text-align: center;
}

.upload-dropzone.is-dragging {
  border-color: var(--bah-primary);
  background: rgba(35, 210, 215, 0.18);
}

.upload-dropzone-icon {
  font-size: 1.5rem;
  color: var(--bah-primary);
}

.upload-dropzone-title {
  color: var(--bah-black);
  font-weight: 700;
  font-size: 0.92rem;
}

.upload-dropzone-hint {
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
}

.upload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.upload-item-name {
  color: var(--bah-black);
  font-size: 0.85rem;
  font-weight: 600;
  word-break: break-word;
}

.upload-item-state {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.upload-item-state.is-pending {
  color: var(--bah-primary);
}

.upload-item-state.is-done {
  color: var(--bah-primary);
}

.upload-item-state.is-error {
  color: var(--bah-black);
}

.support-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 54px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.secondary-link {
  color: var(--bah-black);
  font-weight: 700;
  text-decoration: none;
}

.noscript {
  margin: 0 24px 24px;
  padding: 14px 16px;
  border-left: 3px solid var(--bah-black);
  background: rgba(0, 0, 0, 0.05);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .masthead,
  .masthead-actions,
  .support-band,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .global-nav {
    gap: 14px 18px;
  }

  .auth-dock {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1320px);
  }

  .session-menu {
    min-width: 220px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .auth-pill-button,
  .session-menu-button {
    width: auto;
  }
}
