.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  padding: 0.65rem var(--content-gutter);
  color: #f8fbfb;
  background: rgb(7 24 32 / 94%);
  border-bottom: 1px solid var(--line-dark);
  box-shadow: 0 12px 35px rgb(7 24 32 / 10%);
  backdrop-filter: blur(18px) saturate(1.15);
}

.header-shell {
  display: grid;
  width: min(100%, var(--content-width));
  min-height: 3.45rem;
  grid-template-columns: minmax(13rem, 1fr) auto minmax(13rem, 1fr);
  align-items: center;
  gap: 1rem;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  width: fit-content;
  min-width: 0;
  align-items: center;
  gap: 0.72rem;
  color: #fff;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  display: inline-grid;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--navy-950);
  background: var(--signal);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.82rem;
  box-shadow: inset 0 -2px 0 rgb(7 24 32 / 12%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 0.02rem;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  overflow: hidden;
  color: rgb(255 255 255 / 70%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.primary-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.3rem;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: var(--radius-round);
}

.primary-nav > a {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.78rem;
  color: rgb(255 255 255 / 78%);
  border-radius: var(--radius-round);
  font-size: 0.72rem;
  font-weight: 720;
  text-decoration: none;
  transition:
    color var(--duration-fast) ease,
    background var(--duration-fast) ease;
}

.primary-nav > a:hover {
  color: #fff;
  background: rgb(255 255 255 / 7%);
}

.primary-nav > a[aria-current="page"] {
  color: var(--navy-950);
  background: var(--surface);
  box-shadow: 0 3px 12px rgb(0 0 0 / 18%);
}

.header-account {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.account-chip {
  display: inline-flex;
  max-width: 12rem;
  min-height: 2.35rem;
  align-items: center;
  gap: 0.52rem;
  padding: 0.36rem 0.72rem 0.36rem 0.4rem;
  overflow: hidden;
  color: rgb(255 255 255 / 82%);
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: var(--radius-round);
  font-size: 0.7rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip::before {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--navy-950);
  background: var(--teal-300);
  border-radius: 50%;
  content: attr(data-initial);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.link-button {
  min-height: 2.35rem;
  padding-inline: 0.72rem;
  color: rgb(255 255 255 / 78%);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  font-size: 0.7rem;
}

.link-button:hover {
  color: #fff;
  background: rgb(255 255 255 / 7%);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.page-shell {
  width: min(calc(100% - (var(--content-gutter) * 2)), var(--content-width));
  min-height: calc(100vh - var(--header-height) - 7rem);
  margin: clamp(2rem, 4.5vw, 4.5rem) auto 5rem;
}

.site-footer {
  width: min(calc(100% - (var(--content-gutter) * 2)), var(--content-width));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  color: var(--ink-500);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  text-align: center;
}

.page-intro,
.library-header,
.money-header {
  display: flex;
  max-width: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin: 0 0 clamp(1.8rem, 4vw, 3.2rem);
}

.page-intro > div:first-child,
.library-header > div:first-child,
.money-header > div:first-child {
  max-width: 54rem;
}

.page-intro h1,
.library-header h1,
.money-header h1,
.auth-card h1 {
  max-width: 62rem;
  margin: 0;
  font-size: var(--text-display);
  font-weight: 560;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.page-intro p:not(.eyebrow),
.library-header p:not(.eyebrow) {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: var(--ink-650);
  font-size: clamp(0.92rem, 1.3vw, 1.06rem);
  line-height: 1.68;
}

.compact-intro h1,
.batch-intro h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  color: var(--teal-700);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 1.2rem;
  height: 0.18rem;
  content: "";
  background: var(--signal-strong);
  border-radius: 1rem;
}

.intro-metrics {
  display: grid;
  min-width: min(25rem, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 1.15rem 0;
  border-block: 1px solid var(--line);
}

.intro-metrics span {
  display: grid;
  gap: 0.2rem;
  padding: 0 1.35rem;
  color: var(--ink-500);
  font-size: var(--text-xs);
}

.intro-metrics span + span {
  border-left: 1px solid var(--line);
}

.intro-metrics strong {
  color: var(--ink-950);
  font-size: 1.65rem;
  font-weight: 590;
}

.grid-two,
.grid-three,
.summary-grid {
  display: grid;
  gap: 1rem;
}

.grid-two,
.summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-heading-row,
.store-heading,
.queue-heading,
.subsection-heading,
.prepared-cover-heading,
.progress-heading,
.minimal-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.section-heading-row h2,
.section-heading-row h3,
.store-heading h2,
.store-heading h3,
.queue-heading h2,
.subsection-heading h3,
.prepared-cover-heading h3,
.minimal-section-heading h2 {
  margin-bottom: 0;
}

.section-heading-row .help-text,
.store-heading .help-text,
.queue-heading p,
.subsection-heading p,
.prepared-cover-heading p,
.minimal-section-heading p {
  margin-top: 0.35rem;
}

.action-row,
.choice-row,
.drive-admin-actions,
.money-filter-actions,
.money-toolbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
