.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 2vw, 2rem);
}
.nav-links a {
  color: rgba(244, 241, 232, 0.68);
  font:
    600 0.68rem Gail,
    monospace;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: #4dd8d2;
}
.nav-action {
  padding: 0.8rem 1rem;
  border: 1px solid rgba(77, 216, 210, 0.5);
  color: #4dd8d2 !important;
}
@media (max-width: 760px) {
  .nav {
    height: auto;
    min-height: 4.5rem;
    padding: 0.75rem 1rem;
    gap: 0.8rem;
  }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.2rem 0;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-action {
    white-space: nowrap;
  }
}

body:has(.builder) .builder {
  background: var(--night);
  box-shadow: 1.4rem 1.4rem 0 #16383b;
  color: var(--paper);
}
body:has(.builder) .builder-head {
  position: relative;
  z-index: 2;
  background: var(--paper);
  color: var(--ink);
}
body:has(.builder) .desk {
  position: relative;
  display: block;
  aspect-ratio: 1.6;
  background: url("assets/kai-paycheck-builder.webp") center/cover no-repeat;
  overflow: hidden;
}
body:has(.builder) .roles {
  position: absolute;
  inset: 3% auto 3% 3.5%;
  width: 42%;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  gap: 4%;
}
body:has(.builder) .roles-label {
  position: absolute;
  left: 0;
  bottom: -2rem;
  width: 100%;
  margin: 0;
  color: rgba(244, 241, 232, 0.5);
}
body:has(.builder) .role {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 0.7rem 1rem;
  padding: clamp(1rem, 2vw, 2rem) clamp(1.2rem, 2.4vw, 2.6rem);
  border: 0;
  color: var(--paper);
  background: linear-gradient(
    90deg,
    rgba(7, 23, 25, 0.78),
    rgba(7, 23, 25, 0.18)
  );
  transition: 0.25s;
}
body:has(.builder) .role:hover,
body:has(.builder) .role.selected {
  background: linear-gradient(
    90deg,
    rgba(7, 23, 25, 0.93),
    rgba(7, 23, 25, 0.28)
  );
  transform: translateX(0.35rem);
}
body:has(.builder) .role-icon {
  display: none;
}
body:has(.builder) .role h3 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(1.8rem, 3vw, 3.3rem);
}
body:has(.builder) .role p {
  grid-column: 1/-1;
  max-width: 34rem;
  color: rgba(244, 241, 232, 0.78);
  font-size: clamp(0.82rem, 1vw, 1.05rem);
  line-height: 1.45;
}
body:has(.builder) .add {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 5rem;
  color: var(--aqua);
  border-color: rgba(77, 216, 210, 0.55);
}
body:has(.builder) .role.selected .add {
  color: var(--petrol);
}
body:has(.builder) .workload {
  display: grid;
  grid-column: 1/-1;
  padding: 0;
}
body:has(.builder) .workload button {
  color: var(--paper);
  border-color: rgba(244, 241, 232, 0.28);
  font-size: clamp(0.52rem, 0.68vw, 0.72rem);
}
body:has(.builder) .workload button.active {
  background: var(--aqua);
  color: var(--petrol);
}
body:has(.builder) .payslip-wrap {
  position: absolute;
  inset: 11% 5.7% 6% auto;
  width: 22%;
  padding: 0;
  background: transparent;
}
body:has(.builder) .machine {
  height: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
body:has(.builder) .machine-top {
  position: absolute;
  z-index: 2;
  top: 1.5%;
  left: 0;
  right: 0;
  padding: 0;
  color: rgba(244, 241, 232, 0.65);
}
body:has(.builder) .payslip {
  height: 63%;
  min-height: 0;
  margin-top: 34%;
  padding: clamp(0.7rem, 1.4vw, 1.4rem) clamp(0.8rem, 1.5vw, 1.5rem);
  background: transparent;
  background-image: none;
  color: var(--ink);
  overflow: auto;
  scrollbar-width: none;
}
body:has(.builder) .payslip h2 {
  font-size: clamp(1.5rem, 2.8vw, 3rem);
}
body:has(.builder) .slip-meta {
  padding: 0.5rem 0 1rem;
  font-size: clamp(0.35rem, 0.5vw, 0.56rem);
}
body:has(.builder) .line {
  padding: clamp(0.35rem, 0.65vw, 0.7rem) 0;
  font-size: clamp(0.55rem, 0.72vw, 0.8rem);
}
body:has(.builder) .empty {
  padding: 1.5rem 0;
  font-size: clamp(0.6rem, 0.8vw, 0.85rem);
}
body:has(.builder) .total {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
}
body:has(.builder) .total strong {
  font-size: clamp(1.3rem, 2vw, 2.1rem);
}
body:has(.builder) .pending {
  text-align: left;
}
body:has(.builder) .slip-action {
  padding: 0.7rem;
  font-size: clamp(0.42rem, 0.58vw, 0.62rem);
}
body:has(.builder) .promise {
  background: var(--paper);
  color: var(--ink);
}
@media (max-width: 800px) {
  body:has(.builder) .builder {
    width: calc(100% - 1rem);
  }
  body:has(.builder) .builder-head {
    padding: 3.5rem 1.5rem;
  }
  body:has(.builder) .desk {
    aspect-ratio: auto;
    min-height: 88rem;
    background-position: center top;
    background-size: auto 44rem;
    background-color: #0b1c1e;
    padding: 2rem 1rem;
  }
  body:has(.builder) .roles {
    position: relative;
    inset: auto;
    width: 100%;
    height: 40rem;
    display: grid;
    gap: 1rem;
  }
  body:has(.builder) .roles-label {
    display: none;
  }
  body:has(.builder) .role {
    padding: 1.2rem;
    background: rgba(7, 23, 25, 0.78);
    border: 1px solid rgba(77, 216, 210, 0.18);
  }
  body:has(.builder) .role:hover,
  body:has(.builder) .role.selected {
    transform: none;
  }
  body:has(.builder) .role h3 {
    font-size: 1.7rem;
  }
  body:has(.builder) .role p {
    font-size: 0.8rem;
  }
  body:has(.builder) .payslip-wrap {
    position: relative;
    inset: auto;
    width: min(20rem, 88%);
    height: 40rem;
    margin: 5rem auto 0;
    background: var(--aged);
    padding: 1rem;
  }
  body:has(.builder) .machine {
    padding: 0.6rem;
    background: var(--petrol);
  }
  body:has(.builder) .machine-top {
    position: relative;
    padding: 0.35rem;
  }
  body:has(.builder) .payslip {
    height: 35rem;
    margin: 0;
    padding: 2rem 1.2rem;
    background: #fffdf7;
  }
  body:has(.builder) .payslip h2 {
    font-size: 2.5rem;
  }
  body:has(.builder) .slip-meta {
    font-size: 0.5rem;
  }
  body:has(.builder) .line {
    font-size: 0.78rem;
  }
  body:has(.builder) .promise {
    grid-template-columns: 1fr;
  }
}

body:has(.archive) .archive {
  position: relative;
  background: var(--night);
  color: var(--paper);
}
body:has(.archive) .archive-head {
  background: var(--paper);
  color: var(--ink);
}
body:has(.archive) .filters {
  background: var(--petrol);
  border-color: rgba(244, 241, 232, 0.14);
}
body:has(.archive) .filters button {
  color: rgba(244, 241, 232, 0.72);
  border-color: rgba(244, 241, 232, 0.2);
}
body:has(.archive) .filters button.active {
  background: var(--aqua);
  color: var(--petrol);
}
body:has(.archive) .stories {
  position: relative;
  aspect-ratio: 1.6;
  padding: 0;
  background: url("assets/kai-blog-archive.webp") center/cover no-repeat;
  overflow: hidden;
}
body:has(.archive) .story {
  position: absolute;
  left: 19%;
  width: 32%;
  height: 10.5%;
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border: 0;
  color: var(--ink);
}
body:has(.archive) .story:nth-child(1) {
  top: 5%;
}
body:has(.archive) .story:nth-child(2) {
  top: 18.5%;
}
body:has(.archive) .story:nth-child(3) {
  top: 32%;
}
body:has(.archive) .story:nth-child(4) {
  top: 45.5%;
}
body:has(.archive) .story:nth-child(5) {
  top: 59%;
}
body:has(.archive) .story:nth-child(6) {
  top: 72.5%;
}
body:has(.archive) .story:nth-child(7) {
  display: none;
}
body:has(.archive) .story .issue {
  font-size: clamp(0.4rem, 0.55vw, 0.6rem);
}
body:has(.archive) .story h3 {
  font-size: clamp(0.9rem, 1.3vw, 1.5rem);
  line-height: 0.93;
}
body:has(.archive) .story p {
  display: none;
}
body:has(.archive) .newsletter {
  position: absolute;
  right: 4%;
  bottom: 8%;
  width: 29%;
  grid-template-columns: 1fr;
  padding: 2rem;
  background: rgba(7, 23, 25, 0.88);
  border: 1px solid rgba(77, 216, 210, 0.22);
}
body:has(.archive) .newsletter h2 {
  font-size: clamp(2.2rem, 3vw, 3.5rem);
}
body:has(.archive) .newsletter form {
  display: grid;
}
body:has(.archive) .newsletter input {
  min-width: 0;
  width: 100%;
}
@media (max-width: 760px) {
  body:has(.archive) .stories {
    aspect-ratio: auto;
    min-height: 70rem;
    padding: 4rem 1rem;
    background-position: 38% top;
    background-size: auto 48rem;
  }
  body:has(.archive) .story,
  body:has(.archive) .story:nth-child(n) {
    position: relative;
    inset: auto;
    display: grid;
    width: 100%;
    height: auto;
    min-height: 7rem;
    margin: 0.7rem 0;
    padding: 1rem;
    background: rgba(244, 241, 232, 0.94);
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  body:has(.archive) .story:nth-child(7) {
    display: grid;
  }
  body:has(.archive) .story h3 {
    font-size: 1.55rem;
  }
  body:has(.archive) .newsletter {
    position: relative;
    inset: auto;
    width: 100%;
    margin-top: 2rem;
    padding: 2rem 1.2rem;
  }
}

/* Scalable newsroom archive */
body:has(.archive) .stories {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  aspect-ratio: auto;
  min-height: 0;
  padding: clamp(1rem, 3vw, 3rem);
  gap: 1px;
  background: rgba(244, 241, 232, 0.18);
}
body:has(.archive) .story,
body:has(.archive) .story:nth-child(n) {
  position: relative;
  inset: auto;
  display: flex;
  width: auto;
  height: auto;
  min-height: 24rem;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 2rem;
  background:
    linear-gradient(0deg, rgba(7, 23, 25, 0.96), rgba(7, 23, 25, 0.1) 75%),
    url("assets/kai-blog-field-notes.webp") center/cover;
  color: var(--paper);
  overflow: hidden;
}
body:has(.archive) .story:nth-child(2n) {
  background-image:
    linear-gradient(0deg, rgba(7, 23, 25, 0.96), rgba(7, 23, 25, 0.12) 75%),
    url("assets/kai-blog-archive.webp");
}
body:has(.archive) .story:first-child {
  grid-column: span 2;
  min-height: 32rem;
}
body:has(.archive) .story:nth-child(7) {
  display: flex;
}
body:has(.archive) .story .issue {
  color: var(--aqua);
  font-size: 0.6rem;
}
body:has(.archive) .story h3 {
  max-width: 18ch;
  color: var(--paper);
  font-size: clamp(1.8rem, 2.6vw, 3rem);
  line-height: 0.94;
}
body:has(.archive) .story p {
  display: block;
  max-width: 32rem;
  color: rgba(244, 241, 232, 0.68);
}
body:has(.archive) .newsletter {
  position: relative;
  inset: auto;
  width: auto;
  grid-template-columns: 1fr auto;
  padding: clamp(3rem, 6vw, 6rem);
  background: var(--petrol);
  border: 0;
}
body:has(.archive) .newsletter form {
  display: flex;
}
body:has(.archive) .newsletter input {
  min-width: min(24rem, 48vw);
}
@media (max-width: 760px) {
  body:has(.archive) .stories {
    grid-template-columns: 1fr;
    padding: 1px;
  }
  body:has(.archive) .story,
  body:has(.archive) .story:nth-child(n) {
    min-height: 26rem;
    margin: 0;
    padding: 1.5rem;
    background-size: cover;
  }
  body:has(.archive) .story:first-child {
    grid-column: auto;
    min-height: 30rem;
  }
  body:has(.archive) .story h3 {
    font-size: 2rem;
  }
  body:has(.archive) .newsletter {
    grid-template-columns: 1fr;
  }
  body:has(.archive) .newsletter form {
    display: grid;
  }
  body:has(.archive) .newsletter input {
    min-width: 0;
  }
}
@media (max-width: 800px) {
  body:has(.builder) .roles {
    height: 46rem;
    grid-template-rows: repeat(2, 1fr);
  }
  body:has(.builder) .role h3 {
    font-size: 2rem;
  }
  body:has(.builder) .role p {
    font-size: 0.9rem;
  }
  body:has(.builder) .workload {
    display: grid;
  }
  body:has(.builder) .workload button {
    font-size: 0.62rem;
    line-height: 1.3;
  }
}
