/* Cultivera project rail · Release 1 (r48)
   Authoritative sticky project navigation.
   Replaces r42, r45 and convergence-r1.
   Conforms to: AUTHORITY.md, REPOSITORY_GOVERNANCE.md, CULTIVERA_QA_CODING_LESSONS.md
*/

/* -------------------------------------------------------------
   Scroll Margin & Anchored Headings Safety
   ------------------------------------------------------------- */
:is([data-project-section], [data-project-chapter], .project-main > section, main[data-project-main] > section, .bc60-section, .r43-hero + section, section[id]) {
  scroll-margin-top: calc(var(--global-nav-height, 58px) + 60px);
}

@media (max-width: 760px) {
  :is([data-project-section], [data-project-chapter], .project-main > section, main[data-project-main] > section, .bc60-section, .r43-hero + section, section[id]) {
    scroll-margin-top: 64px;
  }
}

/* -------------------------------------------------------------
   Sticky Rail Shell & Base Geometry
   ------------------------------------------------------------- */
.r48-project-nav,
.r48-project-sheet,
.r48-project-nav__next-wrap {
  /* Secondary nav text: the project's muted colour pulled toward its ink, so it keeps 4.5:1 on
     every project's paper (some projects' muted greys sit just under it). */
  --r48-muted: color-mix(in srgb, var(--cv-project-muted, #56645a) 70%, var(--cv-project-ink, #152219));
  /* Accent text in the step cards and end pager, pulled slightly toward the ink for the same reason. */
  --r48-accent: color-mix(in srgb, var(--cv-project-accent, #2d5a3f) 78%, var(--cv-project-ink, #152219));
  /* Selected text also sits on compounded accent tints; keep the graphic accent intact. */
  --r48-accent-text: color-mix(in srgb, var(--cv-project-accent, #2d5a3f) 50%, var(--cv-project-ink, #152219));
}

.r48-project-nav {
  position: sticky;
  top: var(--global-nav-height, var(--nav-height, 56px));
  z-index: 80;
  border-bottom: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 16%, transparent);
  background: color-mix(in srgb, var(--cv-project-paper, #f7f5f0) 97%, white 3%);
  backdrop-filter: blur(14px) saturate(1.02);
  -webkit-backdrop-filter: blur(14px) saturate(1.02);
  transition: top .32s var(--cv-shell-ease, cubic-bezier(.16,1,.3,1)),
              transform .32s var(--cv-shell-ease, cubic-bezier(.16,1,.3,1)),
              background-color .24s ease;
  font-family: var(--cv-project-font-sans, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: var(--cv-project-ink, #152219);
}

/* Global nav scroll-reveal coordination */
html.cv-global-nav-hidden .r48-project-nav {
  top: 0;
}

.r48-project-nav__bar {
  width: min(1280px, calc(100vw - 32px));
  min-height: 52px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

/* -------------------------------------------------------------
   Left Section: Back to Field Systems + Project Switcher Trigger
   ------------------------------------------------------------- */
.r48-project-nav__left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.r48-project-nav__portfolio {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 0 0;
  border-right: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 14%, transparent);
  color: var(--r48-muted);
  font: 650 11px/1 var(--cv-project-font-mono, "JetBrains Mono", monospace);
  letter-spacing: .055em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}

.r48-project-nav__portfolio span[aria-hidden="true"] {
  color: var(--cv-project-accent, #2d5a3f);
  font-size: 13px;
  line-height: 1;
}

.r48-project-nav__portfolio:is(:hover, :focus-visible) {
  color: var(--cv-project-ink, #152219);
}

.r48-project-nav__switcher-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--cv-project-ink, #152219);
  font: 680 13px/1.2 var(--cv-project-font-sans, Inter, sans-serif);
  text-align: left;
  border-radius: 4px;
  transition: background-color .16s ease, color .16s ease;
  white-space: nowrap;
}

.r48-project-nav__switcher-trigger:is(:hover, :focus-visible) {
  background-color: color-mix(in srgb, var(--cv-project-ink, #152219) 6%, transparent);
}

.r48-project-nav__switcher-trigger .r48-chevron {
  font-size: 10px;
  color: var(--r48-muted);
  transition: transform .2s ease;
  line-height: 1;
}

.r48-project-nav.is-switcher-open .r48-project-nav__switcher-trigger .r48-chevron {
  transform: rotate(180deg);
}

/* Chapters folded into More, and More itself when empty, are hidden with the attribute. */
.r48-project-nav :is(li, a)[hidden] {
  display: none !important;
}

/* -------------------------------------------------------------
   Previous / Next Project Steps
   Two steps beside the switcher move through the project order without returning to
   Field Systems. Hover or keyboard focus shows where a step goes: status, place, one line.
   ------------------------------------------------------------- */
.r48-project-nav__pager {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-left: 10px;
  border-left: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 14%, transparent);
}

.r48-project-nav__step {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  color: var(--r48-muted);
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}

.r48-project-nav__step-arrow {
  font-size: 14px;
  line-height: 1;
}

.r48-project-nav__step:is(:hover, :focus-visible) {
  background-color: color-mix(in srgb, var(--cv-project-ink, #152219) 6%, transparent);
  color: var(--cv-project-ink, #152219);
}

.r48-project-nav__step:focus-visible {
  outline: 2px solid var(--cv-project-accent, #2d5a3f);
  outline-offset: 2px;
}

.r48-step-card {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 5;
  width: min(300px, calc(100vw - 24px));
  box-sizing: border-box;
  display: grid;
  gap: 6px;
  padding: 14px 16px 15px;
  border: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 14%, transparent);
  border-radius: 6px;
  background: var(--cv-project-paper, #f7f5f0);
  box-shadow: 0 16px 36px -20px rgba(21, 34, 25, .5);
  color: var(--cv-project-ink, #152219);
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  pointer-events: none;
}

.r48-project-nav__step:focus-visible .r48-step-card {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity .16s ease, transform .16s ease, visibility 0s;
}

@media (hover: hover) {
  .r48-project-nav__step:hover .r48-step-card {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity .16s ease .08s, transform .16s ease .08s, visibility 0s linear .08s;
  }
}

.r48-project-nav.is-switcher-open .r48-step-card {
  display: none;
}

.r48-step-card__dir {
  color: var(--r48-muted);
  font: 600 10px/1.2 var(--cv-project-font-mono, "JetBrains Mono", monospace);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.r48-step-card__title {
  font: 650 15px/1.2 var(--cv-project-font-sans, Inter, sans-serif);
}

.r48-step-card__meta {
  color: var(--r48-accent);
  font: 560 11.5px/1.35 var(--cv-project-font-sans, Inter, sans-serif);
}

.r48-step-card__line {
  color: color-mix(in srgb, var(--cv-project-ink, #152219) 82%, transparent);
  font: 400 12.5px/1.45 var(--cv-project-font-sans, Inter, sans-serif);
}

/* -------------------------------------------------------------
   Center Section (Desktop ≥1100px): Key Chapters + More Dropdown
   ------------------------------------------------------------- */
.r48-project-nav__center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.r48-project-nav__chapters {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.r48-project-nav__chapter-link {
  position: relative;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--r48-muted);
  font: 560 12px/1 var(--cv-project-font-sans, Inter, sans-serif);
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}

.r48-project-nav__chapter-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--cv-project-accent, #2d5a3f);
  opacity: 0;
  transform: scaleX(.4);
  transform-origin: center;
  transition: opacity .18s ease, transform .2s ease;
}

.r48-project-nav__chapter-link:is(:hover, :focus-visible) {
  color: var(--cv-project-ink, #152219);
}

.r48-project-nav__chapter-link[aria-current="location"] {
  color: var(--cv-project-ink, #152219);
  font-weight: 680;
}

.r48-project-nav__chapter-link[aria-current="location"]::after {
  opacity: 1;
  transform: scaleX(1);
}

/* More Chapters Dropdown */
.r48-project-nav__more {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.r48-project-nav__more-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  min-height: 52px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--r48-muted);
  font: 560 12px/1 var(--cv-project-font-sans, Inter, sans-serif);
  position: relative;
  transition: color .18s ease;
}

.r48-project-nav__more-trigger::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  background: var(--cv-project-accent, #2d5a3f);
  opacity: 0;
  transform: scaleX(.4);
  transition: opacity .18s ease, transform .2s ease;
}

.r48-project-nav__more-trigger:is(:hover, :focus-visible) {
  color: var(--cv-project-ink, #152219);
}

.r48-project-nav__more-trigger.is-active,
.r48-project-nav__more-trigger[aria-current="location"] {
  color: var(--cv-project-ink, #152219);
  font-weight: 680;
}

.r48-project-nav__more-trigger.is-active::after,
.r48-project-nav__more-trigger[aria-current="location"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.r48-project-nav__more-trigger .r48-chevron {
  font-size: 10px;
  transition: transform .2s ease;
}

.r48-project-nav.is-more-open .r48-project-nav__more-trigger .r48-chevron {
  transform: rotate(180deg);
}

.r48-project-nav__more-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  padding: 8px 0;
  background: var(--cv-project-paper, #f7f5f0);
  border: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 16%, transparent);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.r48-project-nav__more-panel[hidden] {
  display: none;
}

.r48-project-nav__more-panel a {
  padding: 9px 16px;
  color: var(--cv-project-ink, #152219);
  font: 520 13px/1.3 var(--cv-project-font-sans, Inter, sans-serif);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background-color .15s ease, color .15s ease;
}

.r48-project-nav__more-panel a:is(:hover, :focus-visible) {
  background-color: color-mix(in srgb, var(--cv-project-ink, #152219) 6%, transparent);
}

.r48-project-nav__more-panel a[aria-current="location"] {
  color: var(--r48-accent-text);
  font-weight: 680;
  background-color: color-mix(in srgb, var(--cv-project-accent, #2d5a3f) 8%, transparent);
}

.r48-project-nav__chapter-idx {
  color: var(--r48-muted);
  font: 600 10.5px/1 var(--cv-project-font-mono, monospace);
  letter-spacing: .04em;
}

/* -------------------------------------------------------------
   Compact / Phone Current Chapter Control (≤1099px)
   ------------------------------------------------------------- */
.r48-project-nav__compact-ctrl {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 16%, transparent);
  border-radius: 4px;
  padding: 6px 10px;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--cv-project-ink, #152219);
  font: 600 12px/1 var(--cv-project-font-mono, "JetBrains Mono", monospace);
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease;
}

.r48-project-nav__compact-ctrl:is(:hover, :focus-visible) {
  background-color: color-mix(in srgb, var(--cv-project-ink, #152219) 6%, transparent);
}

.r48-project-nav__compact-ctrl .r48-chevron {
  font-size: 10px;
  color: var(--r48-muted);
}

/* Compact Dropdown Panel (761px–1099px) */
.r48-project-nav__compact-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 10px 0;
  background: var(--cv-project-paper, #f7f5f0);
  border: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 16%, transparent);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .14);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.r48-project-nav__compact-panel[hidden] {
  display: none;
}

.r48-project-nav__compact-panel a {
  padding: 10px 18px;
  color: var(--cv-project-ink, #152219);
  font: 520 13px/1.3 var(--cv-project-font-sans, Inter, sans-serif);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background-color .15s ease;
}

.r48-project-nav__compact-panel a:is(:hover, :focus-visible) {
  background-color: color-mix(in srgb, var(--cv-project-ink, #152219) 6%, transparent);
}

.r48-project-nav__compact-panel a[aria-current="location"] {
  color: var(--r48-accent-text);
  font-weight: 680;
  background-color: color-mix(in srgb, var(--cv-project-accent, #2d5a3f) 8%, transparent);
}

/* -------------------------------------------------------------
   Right Section: Rail Action CTA
   ------------------------------------------------------------- */
.r48-project-nav__right {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.r48-project-nav__action,
a.r48-project-nav__action {
  min-height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cv-project-ink, #152219);
  color: var(--cv-project-paper, #f7f5f0);
  border: 1px solid var(--cv-project-ink, #152219);
  border-radius: 4px;
  font: 600 11.5px/1 var(--cv-project-font-mono, "JetBrains Mono", monospace);
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.r48-project-nav__action:is(:hover, :focus-visible) {
  background: var(--cv-project-accent, #2d5a3f);
  border-color: var(--cv-project-accent, #2d5a3f);
  color: #fff;
}

/* -------------------------------------------------------------
   Desktop Switcher Dropdown Panel (≥761px)
   ------------------------------------------------------------- */
.r48-project-nav__switcher-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: min(480px, calc(100vw - 32px));
  max-height: min(75vh, 600px);
  overflow-y: auto;
  padding: 16px;
  background: var(--cv-project-paper, #f7f5f0);
  border: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 16%, transparent);
  border-radius: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .14);
  z-index: 100;
}

.r48-project-nav__switcher-panel[hidden] {
  display: none;
}

.r48-switcher-group {
  margin-bottom: 18px;
}

.r48-switcher-group:last-child {
  margin-bottom: 0;
}

.r48-switcher-group__title {
  color: var(--r48-muted);
  font: 700 10.5px/1 var(--cv-project-font-mono, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 12%, transparent);
  margin: 0 0 8px 0;
}

.r48-switcher-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.r48-switcher-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--cv-project-ink, #152219);
  border-left: 3px solid transparent;
  transition: background-color .15s ease, border-left-color .15s ease;
  box-sizing: border-box;
}

.r48-switcher-item:is(:hover, :focus-visible) {
  background-color: color-mix(in srgb, var(--cv-project-ink, #152219) 6%, transparent);
}

.r48-switcher-item:focus-visible {
  outline: 2px solid var(--cv-project-accent, #2d5a3f);
  outline-offset: -2px;
}

.r48-switcher-item[aria-current="page"] {
  background-color: color-mix(in srgb, var(--cv-project-accent, #2d5a3f) 14%, transparent);
  border-left-color: var(--cv-project-accent, #2d5a3f);
}

.r48-switcher-item[aria-current="page"] .r48-switcher-item__title {
  font-weight: 700;
  color: var(--cv-project-ink, #152219);
}

.r48-switcher-item__header {
  display: flex;
  align-items: baseline;
  gap: 6px 8px;
  flex-wrap: wrap;
  width: 100%;
}

.r48-switcher-item__title {
  font: 600 13px/1.3 var(--cv-project-font-sans, Inter, sans-serif);
  color: var(--cv-project-ink, #152219);
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.r48-switcher-item__current {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--cv-project-accent, #2d5a3f) 18%, transparent);
  color: var(--r48-accent-text);
  font: 700 9px/1.2 var(--cv-project-font-mono, monospace);
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
  vertical-align: middle;
}

.r48-switcher-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  width: 100%;
  color: var(--r48-muted);
  font: 550 11px/1.35 var(--cv-project-font-mono, monospace);
  white-space: normal;
}

.r48-switcher-item__geo {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.r48-switcher-item__status {
  padding: 2px 6px;
  border-radius: 3px;
  background-color: color-mix(in srgb, var(--cv-project-ink, #152219) 8%, transparent);
  color: var(--cv-project-ink, #152219);
  font: 600 10px/1.2 var(--cv-project-font-mono, monospace);
  white-space: nowrap;
  flex-shrink: 0;
}

.r48-switcher-item[aria-current="page"] .r48-switcher-item__status {
  background-color: color-mix(in srgb, var(--cv-project-accent, #2d5a3f) 18%, transparent);
  color: var(--cv-project-ink, #152219);
}

/* -------------------------------------------------------------
   Phone Modal Bottom Sheet (≤760px)
   ------------------------------------------------------------- */
.r48-project-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 20, 16, .6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.r48-project-sheet-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.r48-project-sheet-backdrop[hidden] {
  display: none !important;
}

.r48-project-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  background: var(--cv-project-paper, #f7f5f0);
  border-top: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 18%, transparent);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, .22);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s var(--cv-shell-ease, cubic-bezier(.16,1,.3,1));
}

.r48-project-sheet[hidden] {
  display: none !important;
}

.r48-project-sheet.is-open {
  transform: translateY(0);
}

.r48-project-sheet__head {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 12%, transparent);
}

.r48-project-sheet__tabs {
  display: flex;
  gap: 14px;
  role: tablist;
}

.r48-project-sheet__tab {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 2px;
  position: relative;
  font: 680 13px/1.2 var(--cv-project-font-sans, Inter, sans-serif);
  color: var(--r48-muted);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.r48-project-sheet__tab[aria-selected="true"] {
  color: var(--cv-project-ink, #152219);
}

.r48-project-sheet__tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 2px;
  background: var(--cv-project-accent, #2d5a3f);
}

.r48-project-sheet__close {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--cv-project-ink, #152219);
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  transition: background-color .15s ease;
}

.r48-project-sheet__close:is(:hover, :focus-visible) {
  background-color: color-mix(in srgb, var(--cv-project-ink, #152219) 8%, transparent);
}

.r48-project-sheet__body {
  padding: 16px 18px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.r48-project-sheet__panel[hidden] {
  display: none;
}

/* Sheet On This Page tab */
.r48-sheet-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.r48-sheet-chapter-list a {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 10%, transparent);
  color: var(--cv-project-ink, #152219);
  text-decoration: none;
  font: 540 14px/1.3 var(--cv-project-font-sans, Inter, sans-serif);
  padding: 4px 6px;
}

.r48-sheet-chapter-list a[aria-current="location"] {
  color: var(--r48-accent-text);
  font-weight: 680;
}

.r48-sheet-action-wrap {
  margin-top: 18px;
  padding-top: 12px;
}

.r48-sheet-action-wrap .r48-project-nav__action {
  width: 100%;
  min-height: 44px;
  font-size: 12.5px;
}

/* Sheet Projects Tab (≤760px) */
.r48-project-sheet .r48-switcher-list {
  gap: 4px;
}

.r48-project-sheet .r48-switcher-item {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 5px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 6px;
  box-sizing: border-box;
}

.r48-project-sheet .r48-switcher-item__header {
  display: flex;
  align-items: baseline;
  gap: 6px 8px;
  flex-wrap: wrap;
  width: 100%;
}

.r48-project-sheet .r48-switcher-item__title {
  font: 600 13.5px/1.3 var(--cv-project-font-sans, Inter, sans-serif);
  color: var(--cv-project-ink, #152219);
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.r48-project-sheet .r48-switcher-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  width: 100%;
  color: var(--r48-muted);
  font: 550 11px/1.35 var(--cv-project-font-mono, monospace);
  white-space: normal;
}

.r48-project-sheet .r48-switcher-item__geo {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.r48-project-sheet .r48-switcher-item__status {
  flex-shrink: 0;
}


/* -------------------------------------------------------------
   End-of-page Next Project Text Link (§4)
   ------------------------------------------------------------- */
.r48-project-nav__next-wrap {
  width: min(1200px, calc(100vw - 32px));
  margin: 44px auto 32px;
  padding: 24px 0 8px;
  border-top: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 14%, transparent);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px clamp(28px, 6vw, 96px);
}

.r48-project-nav__next-link {
  display: grid;
  align-content: start;
  gap: 7px;
  max-width: 46ch;
  padding: 4px 0;
  color: var(--r48-muted);
  font: 400 13px/1.45 var(--cv-project-font-sans, Inter, sans-serif);
  text-decoration: none;
  transition: color .18s ease;
}

.r48-project-nav__next-link--next {
  justify-self: end;
  text-align: right;
}

.r48-end-step__dir {
  font: 600 11px/1.2 var(--cv-project-font-mono, "JetBrains Mono", monospace);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.r48-project-nav__next-link strong {
  color: var(--cv-project-ink, #152219);
  font: 650 17px/1.2 var(--cv-project-font-sans, Inter, sans-serif);
}

.r48-end-step__meta {
  color: var(--r48-accent);
  font-weight: 560;
  font-size: 12px;
}

.r48-end-step__line {
  color: color-mix(in srgb, var(--cv-project-ink, #152219) 78%, transparent);
}

.r48-project-nav__next-link:is(:hover, :focus-visible) strong {
  color: var(--cv-project-accent, #2d5a3f);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.r48-project-nav__next-link:focus-visible {
  outline: 2px solid var(--cv-project-accent, #2d5a3f);
  outline-offset: 4px;
  border-radius: 2px;
}

/* -------------------------------------------------------------
   No-JS Fallback Baseline (§6)
   ------------------------------------------------------------- */
.project-subnav-noscript {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px 18px !important;
  width: 100% !important;
  padding: 12px 18px !important;
  box-sizing: border-box !important;
  background: var(--cv-project-paper, #f7f5f0) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--cv-project-ink, #152219) 14%, transparent) !important;
  font: 600 12px/1 var(--cv-project-font-mono, monospace) !important;
}

.project-subnav-noscript a {
  color: var(--cv-project-accent, #2d5a3f) !important;
  text-decoration: underline !important;
}

.project-subnav-noscript span {
  color: var(--r48-muted) !important;
}

/* Retire old floating shuttle & index remnants */
[data-r42-project-shuttle],
.r42-project-shuttle,
.r42-project-index {
  display: none !important;
}

/* -------------------------------------------------------------
   Responsive Breakpoints: 761px–1099px (Compact)
   ------------------------------------------------------------- */
@media (max-width: 1099px) {
  .r48-project-nav__center {
    display: none;
  }

  .r48-project-nav__compact-ctrl {
    display: inline-flex;
  }

  .r48-project-nav__switcher-trigger .r48-switcher-full-title {
    display: none;
  }

  .r48-project-nav__switcher-trigger .r48-switcher-short-title {
    display: inline;
  }
}

@media (min-width: 1100px) {
  .r48-project-nav__switcher-trigger .r48-switcher-full-title {
    display: inline;
  }

  .r48-project-nav__switcher-trigger .r48-switcher-short-title {
    display: none;
  }
}

/* -------------------------------------------------------------
   Responsive Breakpoints: ≤760px (Phone)
   ------------------------------------------------------------- */
@media (max-width: 760px) {
  .r48-project-nav {
    min-height: 48px;
    top: 0;
  }

  /* Rail yields when global nav reveals: slides away */
  html:not(.cv-global-nav-hidden) .r48-project-nav:not(:focus-within):not(.is-sheet-open):not(.is-open) {
    transform: translateY(-100%);
    pointer-events: none;
  }

  html.cv-global-nav-hidden .r48-project-nav {
    transform: translateY(0);
    pointer-events: auto;
  }

  .r48-project-nav__bar {
    width: calc(100vw - 20px);
    min-height: 48px;
    gap: 8px;
  }

  .r48-project-nav__portfolio {
    min-height: 48px;
    padding-right: 8px;
    font-size: 10px;
    letter-spacing: .04em;
  }

  .r48-project-nav__portfolio span[aria-hidden="true"] {
    font-size: 12px;
  }

  .r48-project-nav__switcher-trigger {
    min-height: 44px;
    padding: 0 4px;
    font-size: 11.5px;
  }

  .r48-project-nav__compact-ctrl {
    min-height: 44px;
    padding: 0 8px;
    font-size: 11px;
  }

  .r48-project-nav__pager {
    display: none;
  }

  .r48-project-nav__next-wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    margin-top: 32px;
  }

  .r48-project-nav__next-link--next {
    justify-self: start;
    text-align: left;
  }

  .r48-project-nav__right {
    display: none; /* Action moves into bottom sheet on phone */
  }

  /* Desktop dropdowns disabled on phone, bottom sheet used instead */
  .r48-project-nav__switcher-panel,
  .r48-project-nav__compact-panel {
    display: none !important;
  }
}

/* Responsive evaluator speedrun for fine-pointer / hover-capable devices below 760px */
@media (max-width: 760px) and (hover: hover) and (pointer: fine) {
  .r48-project-nav__pager {
    display: inline-flex;
    padding-left: 6px;
    gap: 2px;
  }

  .r48-project-nav__step {
    width: 28px;
    height: 28px;
  }

  .r48-project-nav__step-arrow {
    font-size: 13px;
  }

  .r48-step-card {
    width: min(280px, calc(100vw - 24px));
    padding: 12px 14px 13px;
  }

  .r48-project-nav__step--prev .r48-step-card {
    left: 50%;
    transform: translate(calc(-50% - 12px), -4px);
  }

  .r48-project-nav__step--prev:focus-visible .r48-step-card,
  .r48-project-nav__step--prev:hover .r48-step-card {
    transform: translate(calc(-50% - 12px), 0);
  }

  .r48-project-nav__step--next .r48-step-card {
    left: 50%;
    transform: translate(calc(-50% - 36px), -4px);
  }

  .r48-project-nav__step--next:focus-visible .r48-step-card,
  .r48-project-nav__step--next:hover .r48-step-card {
    transform: translate(calc(-50% - 36px), 0);
  }
}

@media (max-width: 359px) {
  .r48-project-nav__bar {
    width: calc(100vw - 12px);
  }

  .r48-project-nav__portfolio {
    padding-right: 6px;
    font-size: 9.5px;
  }

  .r48-project-nav__switcher-trigger {
    font-size: 10.5px;
  }

  .r48-project-nav__compact-ctrl {
    font-size: 10px;
    padding: 0 6px;
  }
}

/* -------------------------------------------------------------
   Reduced Motion
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .r48-project-nav,
  .r48-project-sheet,
  .r48-project-sheet-backdrop,
  .r48-project-nav__chapter-link::after,
  .r48-project-nav__more-trigger::after,
  .r48-project-nav__step,
  .r48-step-card,
  .r48-chevron {
    transition: none !important;
  }
}

/* Valid list wrappers preserve the existing anchor-owned row geometry. */
.r48-sheet-chapter-list > li,
.r48-switcher-list > li { list-style: none; margin: 0; padding: 0; }
