/* HART Operator Portal — Ohio River industrial (cool slate, not cream desk) */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Source+Sans+3:ital,wght@0,400;0,600;1,400&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap");

:root {
  --ink: #121a22;
  --ink-soft: #3a4652;
  --muted: #5c6b78;
  --paper: #e4ebf0;
  --paper-2: #d3dde5;
  --card: #f3f6f8;
  --rule: #b7c4cf;
  --brand: #0a3d4a;
  --brand-2: #146377;
  --accent: #c99212;
  --signal: #b33a3a;
  --ok: #2d6a4f;
  --shadow: 0 10px 30px rgba(18, 26, 34, 0.08);
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-story: "Source Serif 4", Georgia, serif;
  --max: 1120px;
  --header-h: 4.1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(20, 99, 119, 0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(201, 146, 18, 0.1), transparent 55%),
    linear-gradient(180deg, #edf2f5 0%, var(--paper) 35%, var(--paper-2) 100%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-2);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--ink);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 246, 248, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header-inner,
.site-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.1rem;
  align-items: center;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--brand);
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
  margin-left: auto;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav .nav-short {
  display: none;
}

[hidden] {
  display: none !important;
}

/* Phone: brand on its own line, the section links share the row below it. */
@media (max-width: 640px) {
  .site-header-inner {
    padding: 0.6rem 1rem;
    gap: 0.45rem 0.8rem;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 0.25rem 1.1rem;
  }

  .nav .nav-home {
    display: none;
  }

  .eng-link {
    margin-left: auto;
  }
}

@media (max-width: 400px) {
  .nav .nav-full {
    display: none;
  }

  .nav .nav-short {
    display: inline;
  }
}

.crumb {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.crumb a {
  color: var(--accent);
  text-decoration: none;
}

.crumb a::after {
  content: " ›";
}

.crumb a:hover {
  color: var(--ink);
}

.eng-link {
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.eng-link:hover {
  background: var(--paper-2);
  color: var(--ink);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
}

main.full-bleed {
  max-width: none;
  padding: 0 0 3rem;
}

main.explorer-page {
  max-width: none;
  width: 100%;
  padding: 1.25rem 1rem 2.5rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--muted);
}

/* —— Home hero —— */
.hero-bleed {
  position: relative;
  min-height: min(92vh, 720px);
  display: grid;
  align-items: end;
  color: #f4f7f9;
  overflow: hidden;
}

.hero-bleed .hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  animation: hero-drift 28s ease-in-out infinite alternate;
  z-index: 0;
}

.hero-bleed::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(10, 61, 74, 0.25) 0%,
    rgba(18, 26, 34, 0.72) 55%,
    rgba(18, 26, 34, 0.88) 100%
  );
  pointer-events: none;
}

@keyframes hero-drift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.5%, -1%, 0);
  }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 4.5rem 1.25rem 2.75rem;
}

.hero-kicker {
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

.hero-bleed h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 5.4rem);
  letter-spacing: 0.02em;
  line-height: 0.95;
  margin: 0 0 0.75rem;
  max-width: 12ch;
}

.hero-bleed .lede {
  font-size: 1.15rem;
  max-width: 38ch;
  color: rgba(243, 246, 248, 0.9);
  margin: 0 0 1.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  background: var(--accent);
  color: #1a1406;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: #e0ab2a;
  color: #1a1406;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(243, 246, 248, 0.55);
  color: #f3f6f8;
}

.btn-ghost:hover {
  background: rgba(243, 246, 248, 0.12);
  color: #fff;
  border-color: #fff;
}

/* Ghost buttons on light page backgrounds (catalog cards, toolbars) need dark ink. */
main:not(.full-bleed) .btn-ghost {
  border-color: var(--rule);
  color: var(--ink);
}

main:not(.full-bleed) .btn-ghost:hover {
  background: var(--paper-2);
  border-color: var(--brand-2);
  color: var(--ink);
}

.btn-ink {
  background: var(--brand);
  color: #f3f6f8;
}

.btn-ink:hover {
  background: var(--brand-2);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.home-band {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
  color: var(--brand);
}

.section-note {
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 54ch;
}

.home-band > .section-note {
  max-width: 62ch;
}

.card-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.1rem 1.15rem 1.2rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-2);
  color: inherit;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
  color: var(--brand);
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.quote-strip {
  margin: 2.5rem 0 0;
  padding: 1.5rem 1.25rem;
  background: var(--brand);
  color: #e8f1f4;
}

.quote-strip-inner {
  max-width: var(--max);
  margin: 0 auto;
  font-family: var(--font-story);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.45;
  max-width: 48ch;
}

.quote-strip cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.quote-strip cite a {
  color: inherit;
}

/* —— Pages —— */
.page-head {
  margin-bottom: 1.35rem;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
  color: var(--brand);
}

.page-head .muted,
.muted {
  color: var(--muted);
}

.prose {
  max-width: 68ch;
}

.prose.story {
  font-family: var(--font-story);
  font-size: 1.08rem;
  line-height: 1.7;
}

.prose p {
  margin: 0 0 1rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  margin: 0 0 0.55rem;
  color: var(--brand);
}

.job-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.job-card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.job-card .code {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0;
}

.job-card h3 {
  margin: 0.15rem 0 0.45rem;
  font-size: 1.05rem;
}

.job-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.swatch-row {
  display: grid;
  gap: 0.55rem;
}

.swatch {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 0.45rem 0.7rem;
}

.swatch .chip {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0.45rem 0.4rem;
  font-weight: 700;
}

.swatch .train {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.industry-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.industry-card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 0;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0;
  overflow: hidden;
}

.industry-card .logo-band {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7.5rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #eef3f6 100%);
  border-bottom: 1px solid var(--rule);
}

.industry-card img.logo {
  width: auto;
  max-width: min(100%, 220px);
  height: 96px;
  object-fit: contain;
  justify-self: center;
  background: transparent;
  padding: 0;
  border: 0;
}

.industry-card .industry-body {
  display: grid;
  gap: 0.65rem;
  padding: 1.1rem 1.15rem 1.25rem;
}

.industry-card h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.industry-card .meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
}

/* —— Gallery —— */
.album-bar,
.album-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.album-bar button,
.album-bar button {
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-soft);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.album-bar button[aria-pressed="true"],
.album-bar button[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #f3f6f8;
}

.gallery-masonry,
.gallery-masonry {
  columns: 1;
  column-gap: 0.85rem;
}

@media (min-width: 640px) {
  .gallery-masonry,
.gallery-masonry {
    columns: 2;
  }
}

@media (min-width: 980px) {
  .gallery-masonry,
.gallery-masonry {
    columns: 3;
  }
}

.g-item {
  break-inside: avoid;
  margin: 0 0 0.85rem;
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 0;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
}

.g-item img {
  width: 100%;
  background: #1a2229;
}

.g-item figcaption {
  padding: 0.65rem 0.75rem 0.85rem;
}

.g-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  color: var(--brand);
  margin-bottom: 0.2rem;
}

.g-item span {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 16, 22, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.lightbox.open {
  display: flex;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-card {
  max-width: min(960px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.lightbox-card img {
  max-height: 70vh;
  width: 100%;
  object-fit: contain;
  background: #111;
}

.lightbox-card .meta {
  padding: 1rem 1.1rem 1.2rem;
}

.lightbox-card h2 {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  color: var(--brand);
}

.lightbox-card p {
  margin: 0 0 0.35rem;
  color: var(--ink-soft);
}

.lightbox-card .credit {
  font-size: 0.8rem;
  color: var(--muted);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(243, 246, 248, 0.92);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0.45rem 0.7rem;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
}

.lightbox-nav.prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* —— F-root review gallery —— */
.review-toolbar {
  margin-bottom: 0.85rem;
}

.review-toolbar .toolbar-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.review-stats {
  margin-top: 0.35rem;
  font-size: 0.88rem;
}

.review-item figcaption {
  position: relative;
}

.review-badge {
  display: inline-block;
  margin: 0.15rem 0 0.35rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
}

.review-badge.pending {
  background: #eef2f5;
  color: var(--ink-soft);
}

.review-badge.delete {
  background: #fdecea;
  color: #8a1c13;
}

.review-badge.archive {
  background: #e8f0ea;
  color: #1f4d2c;
}

.review-badge.review {
  background: #fff6e5;
  color: #7a4d00;
}

.review-badge.suggest {
  background: #eef3ff;
  color: #2a4a8a;
}

.review-excerpt,
.review-suggested,
.review-tags {
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.g-item.decided-delete {
  border-color: #e8b4b0;
}

.g-item.decided-archive {
  border-color: #b8d4c0;
}

.g-item.decided-review {
  border-color: #e8d4a8;
}

.doc-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 10rem;
  background: linear-gradient(145deg, #1a2229, #2a3540);
  color: #d7e2ea;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.doc-thumb.large {
  min-height: 16rem;
}

.review-panel .review-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  max-width: min(1100px, 100%);
}

@media (max-width: 820px) {
  .review-panel .review-card {
    grid-template-columns: 1fr;
  }
}

.review-preview img,
.review-preview iframe {
  width: 100%;
  min-height: 16rem;
  max-height: 70vh;
  object-fit: contain;
  background: #111;
  border: 0;
}

.review-form label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.review-form textarea,
.review-form input {
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.review-path {
  font-size: 0.82rem;
  word-break: break-all;
}

.review-meta {
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.review-actions button {
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--rule);
  cursor: pointer;
}

.review-actions .btn-danger {
  background: #fdecea;
  border-color: #e8b4b0;
  color: #8a1c13;
}

.review-actions .btn-archive {
  background: #e8f0ea;
  border-color: #b8d4c0;
  color: #1f4d2c;
}

.review-actions .btn-review {
  background: #fff6e5;
  border-color: #e8d4a8;
  color: #7a4d00;
}

.review-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  padding: 0.65rem 0.9rem;
  background: var(--brand);
  color: #f3f6f8;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.review-toast.show {
  opacity: 1;
}

.review-toast.err {
  background: #8a1c13;
}

/* —— Existing layout explorer bits —— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.toolbar input,
.toolbar select {
  font: inherit;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--rule);
  background: var(--card);
}

.layout-workspace {
  display: grid;
  gap: 0.9rem;
}

.map-scroll {
  overflow: auto;
  max-height: min(78vh, 720px);
  border: 1px solid var(--rule);
  background: #111418;
  box-shadow: var(--shadow);
}

.explorer-page {
  max-width: none;
  padding-left: 1rem;
  padding-right: 1rem;
}

.page-head-compact h1 {
  margin-bottom: 0.2rem;
}

.page-head-compact p {
  margin: 0.15rem 0;
}

.map-scroll-full {
  max-height: min(82vh, 980px);
  width: 100%;
}

/* Leave room so detail stays on-screen under the map.
   Do not use flex justify-content:center here — it clips the left/top
   overflow so you cannot scroll to the start of a wide map. */
.map-scroll-explorer {
  max-height: min(48vh, 420px);
  width: 100%;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.zoom-controls input[type="range"] {
  width: 7.5rem;
  vertical-align: middle;
}

.zoom-controls #zoom-label {
  min-width: 2.75rem;
  font-variant-numeric: tabular-nums;
}

#map-zoom-wrap {
  position: relative;
  /* Center when the scaled map is smaller than the viewport */
  margin-inline: auto;
}

#map-stage {
  position: relative;
  display: inline-block;
}

#map-stage img {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
}

.detail-below {
  margin: 0.85rem 0 1.5rem;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 0.9rem 1.1rem 1.1rem;
  box-shadow: var(--shadow);
  min-height: 5.5rem;
}

.detail-below h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.55rem;
  color: var(--brand);
}

.detail-below dl {
  margin: 0;
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.3rem 0.75rem;
  font-size: 0.92rem;
}

.detail-below dt {
  color: var(--muted);
}

.detail-below dd {
  margin: 0;
}

.detail-below .empty {
  margin: 0;
  color: var(--muted);
}

.layout-workspace-3 {
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 1100px) {
  .layout-workspace-3 {
    grid-template-columns: minmax(0, 1fr) 220px 280px;
    align-items: start;
  }
}

.device-list-panel {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 0.75rem 0.85rem 1rem;
  box-shadow: var(--shadow);
  max-height: min(78vh, 820px);
  overflow: auto;
}

.device-list-panel h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--brand);
}

.device-list {
  display: grid;
  gap: 0.25rem;
}

.device-list-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.4rem;
  align-items: baseline;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.device-list-item .kind {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.device-list-item[aria-current="true"],
.device-list-item:hover {
  background: rgba(20, 99, 119, 0.08);
  border-color: var(--rule);
}

.hotspot {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.hotspot.turnout {
  background: var(--ok);
}

.hotspot.signal {
  background: var(--signal);
  border-radius: 2px;
}

.hotspot.dim {
  opacity: 0.18;
}

.hotspot.active,
.hotspot:hover {
  transform: scale(1.35);
  outline: 2px solid #ffe08a;
  z-index: 3;
}

.detail-panel {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1rem;
  box-shadow: var(--shadow);
  min-height: 240px;
}

.detail-panel h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.6rem;
}

.detail-panel dl {
  margin: 0;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.35rem 0.55rem;
  font-size: 0.9rem;
}

.detail-panel dt {
  color: var(--muted);
}

.detail-panel dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  word-break: break-word;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--rule);
  background: var(--card);
  box-shadow: var(--shadow);
}

table.roster {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.roster th,
table.roster td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

table.roster th {
  background: var(--paper-2);
  position: sticky;
  top: 0;
}

.guide-body {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.2rem 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}

.guide-body h1,
.guide-body h2,
.guide-body h3 {
  font-family: var(--font-display);
  color: var(--brand);
}

.guide-body pre {
  overflow: auto;
  background: var(--paper-2);
  padding: 0.75rem;
  border: 1px solid var(--rule);
}

.invite-card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.invite-card .when {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
}

.invite-card h2 {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
  color: var(--brand);
}

/* —— Panel browser + publications catalog —— */
.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.panel-tabs button {
  font: inherit;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}

.panel-tabs button[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.panel-stage {
  background: #0d1216;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  padding: 0.75rem;
  overflow: auto;
  max-height: min(78vh, 820px);
}

.panel-stage img {
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.panel-caption {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.device-map-note {
  margin: 1.5rem 0 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(201, 146, 18, 0.12);
  border: 1px solid rgba(201, 146, 18, 0.35);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.catalog-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.catalog-card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.45rem;
}

.catalog-card .kind {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0;
}

.catalog-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
  color: var(--brand);
}

.catalog-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.catalog-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.doc-frame-wrap {
  border: 1px solid var(--rule);
  background: var(--card);
  box-shadow: var(--shadow);
  min-height: 70vh;
}

.doc-frame-wrap iframe {
  width: 100%;
  min-height: 70vh;
  border: 0;
  background: #fff;
}

/* —— Section doors (home) and section hubs —— */
.section-doors {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.section-door {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--brand);
  padding: 1.25rem 1.3rem 1.35rem;
  box-shadow: var(--shadow);
}

.section-door.is-ops {
  border-top-color: var(--accent);
}

.section-door .kind {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-door h3 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: 0.03em;
  line-height: 1.05;
  margin: 0;
}

.section-door h3 a {
  color: var(--brand);
  text-decoration: none;
}

.section-door h3 a:hover {
  color: var(--brand-2);
}

.section-door > p {
  margin: 0;
  color: var(--ink-soft);
}

.door-links {
  list-style: none;
  margin: 0.2rem 0 0.4rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.section-door .btn {
  justify-self: start;
}

.home-about {
  margin: 1.25rem 0 0;
  color: var(--muted);
}

.hub-group {
  margin: 0 0 2rem;
  scroll-margin-top: 6rem; /* homepage links jump here; clear the site header */
}

.hub-group > h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.03em;
  margin: 0 0 0.25rem;
  color: var(--brand);
}

.hub-group > .section-note {
  margin-bottom: 0.9rem;
}

.card .card-kind {
  margin: 0 0 0.2rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.reading-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.reading-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}

.reading-list li:last-child {
  border-bottom: 0;
}

.reading-list a {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand);
}

.reading-list a:hover {
  color: var(--brand-2);
}

.reading-list .kind {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.reading-list p {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  main.full-bleed {
    padding-left: 0;
    padding-right: 0;
  }

  .hero-inner,
  .home-band,
  .quote-strip {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Long file paths in guide text would otherwise push phone pages sideways. */
.guide-body code {
  overflow-wrap: anywhere;
}

/* —— Operations hub: role groups —— */
.tonight {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin: 0 0 1.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--brand);
  color: #e8f1f4;
  border-left: 6px solid var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.tonight:hover {
  background: var(--brand-2);
  color: #fff;
}

.tonight strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.tonight span {
  font-size: 0.95rem;
}

.tonight .tonight-go {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.hub-group.is-quiet > h2 {
  color: var(--ink-soft);
  font-size: 1.3rem;
}

.hub-group.is-quiet .card {
  box-shadow: none;
  background: transparent;
}

.hub-group.is-quiet .card h3 {
  font-size: 1.15rem;
  color: var(--ink-soft);
}

/* —— Session paperwork hub —— */
.crew-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}

.crew-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  min-height: 4.5rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.crew-tile:hover {
  border-color: var(--brand-2);
  color: inherit;
}

.crew-tile .code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: 0.03em;
  color: var(--brand);
  line-height: 1;
  min-width: 3.6rem;
}

.crew-tile strong {
  display: block;
  font-size: 1.02rem;
}

.crew-tile small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.chip-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
}

/* —— Color chip (shared) —— */
.cchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.2rem;
  padding: 0.3rem 0.55rem;
  background: var(--chip);
  color: var(--chip-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  line-height: 1.1;
  border: 1px solid rgba(18, 26, 34, 0.35);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.cchip.is-small {
  min-width: 0;
  padding: 0.12rem 0.4rem;
  font-size: 0.78rem;
}

.cchip.is-dim {
  opacity: 0.28;
  filter: saturate(0.5);
}

.cchip[role="img"] {
  width: 0.9rem;
  height: 0.9rem;
  min-width: 0;
  padding: 0;
  margin-right: 0.35rem;
  vertical-align: -0.1rem;
}

.cc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  max-width: 36rem;
}

.cc-list li {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.cc-list li.is-other a,
.cc-list li.is-other small {
  color: var(--muted);
}

.cc-list li.is-mine a {
  font-weight: 700;
}

.cc-list small {
  color: var(--muted);
  white-space: nowrap;
}

.cc-big li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 1.05rem;
}

/* —— Crew sheet —— */
.page-head.crumb-only {
  margin-bottom: 0.4rem;
}

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0 0.85rem;
  border-bottom: 3px solid var(--brand);
}

.sheet-id {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.sheet-code {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  letter-spacing: 0.02em;
  line-height: 0.9;
  color: var(--accent);
}

.sheet-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--brand);
}

.sheet-pub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.sheet-engine {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.sheet-engine img {
  width: 160px;
  height: auto;
  border: 1px solid var(--rule);
  background: #fff;
}

.sheet-engine small {
  display: block;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.engine-none {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 2px dashed var(--rule);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.sheet-summary {
  font-size: 1.08rem;
  max-width: 62ch;
  margin: 0 0 1.25rem;
}

.sheet-sec {
  margin: 0 0 1.5rem;
  max-width: 62rem;
}

.sheet-sec h2,
.sub-h {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  color: var(--brand);
  margin: 0 0 0.5rem;
}

.sub-h {
  margin-top: 1.5rem;
}

.sheet-sec h3 {
  margin: 0.9rem 0 0.35rem;
  font-size: 1.02rem;
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.link-btn {
  font: inherit;
  font-size: 0.85rem;
  background: none;
  border: 0;
  padding: 0.3rem 0;
  color: var(--brand-2);
  text-decoration: underline;
  cursor: pointer;
}

.small {
  font-size: 0.88rem;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 1.15rem;
  line-height: 1.45;
}

.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--rule);
}

.steps label {
  display: grid;
  grid-template-columns: 2rem 1.6rem 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
}

.steps label::before {
  content: counter(step);
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--accent);
}

.steps input {
  grid-column: 2;
  grid-row: 1;
  width: 1.3rem;
  height: 1.3rem;
  margin: 0.2rem 0 0;
  accent-color: var(--ok);
}

.steps span {
  grid-column: 3;
  grid-row: 1;
}

.steps input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(18, 26, 34, 0.35);
}

.seq {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.seq li {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--rule);
}

.seq-n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--accent);
}

.seq p {
  margin: 0;
}

.seq-train {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.03em;
}

.seq-action {
  font-size: 1.08rem;
}

.seq-chips {
  margin-top: 0.35rem !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.prio-strip {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.2rem;
  align-items: center;
}

.prio-strip li {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--brand);
}

.prio-strip li span {
  padding: 0.3rem 0.6rem;
  background: var(--card);
  border: 1px solid var(--brand);
}

.prio-strip li:first-child span {
  background: var(--brand);
  color: #fff;
}

.prio-strip li:not(:last-child)::after {
  content: "→";
  margin: 0 0.3rem;
  color: var(--muted);
  font-weight: 600;
}

.map-cards {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
}

.map-card {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.6rem;
  align-items: center;
  padding: 0.4rem;
  background: var(--card);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}

.map-card:hover {
  border-color: var(--brand-2);
  color: inherit;
}

.map-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--rule);
}

.map-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brand);
}

.map-card small {
  color: var(--muted);
}

.talk {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: 0.4rem 1rem;
}

.talk dt {
  font-weight: 700;
}

.talk dd {
  margin: 0;
}

.sheet-more {
  margin: 0 0 1rem;
  max-width: 62rem;
  background: var(--card);
  border: 1px solid var(--rule);
}

.sheet-more > summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  color: var(--brand);
}

.sheet-more > :not(summary) {
  margin: 0 1rem 1rem;
}

.sheet-more .table-wrap {
  box-shadow: none;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.sheet-actions .btn {
  min-height: 2.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.print-only {
  display: none;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.data-table th,
table.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--rule);
}

table.data-table thead th {
  background: var(--brand);
  color: #f3f6f8;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

table.data-table tbody th {
  font-weight: 700;
}

.tt-table td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tt-table td,
.tt-table thead th:first-child,
.tt-table thead th:last-child {
  text-align: center;
}

.tt-note,
.tt-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.tt-sub {
  font-family: var(--font-story);
  font-size: 1.02rem;
  margin: -0.6rem 0 1rem;
}

.tt-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: start;
}

.sw-badge {
  display: inline-block;
  min-width: 2.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: #0f4761;
  color: #fff;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.verdict {
  padding: 0.05rem 0.35rem;
  color: #fff;
}

.verdict-pass {
  background: var(--ok);
}

.verdict-rejected {
  background: var(--signal);
}

.rule-list li {
  margin-bottom: 0.3rem;
}

/* Phones: the sheet header sticks; the site header scrolls away. */
@media (max-width: 640px) {
  body.crew-sheet .site-header {
    position: static;
  }

  body.crew-sheet .sheet-head {
    position: sticky;
    top: 0;
    z-index: 40;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0.55rem 1rem 0.6rem;
    background: rgba(237, 242, 245, 0.97);
    backdrop-filter: blur(8px);
    gap: 0.35rem 0.8rem;
  }

  body.crew-sheet .sheet-eff {
    display: none;
  }

  .sheet-engine {
    font-size: 0.85rem;
  }

  .sheet-engine img {
    width: 96px;
  }

  .cc-list li {
    grid-template-columns: 4.9rem minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .cchip {
    min-width: 4.6rem;
    font-size: 0.85rem;
  }

  .talk {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .talk dd {
    margin-bottom: 0.5rem;
  }
}

/* —— Station maps —— */
.map-figure,
.key-map {
  margin: 0 0 1.25rem;
}

.map-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--rule);
  background: #fff;
  cursor: zoom-in;
  box-shadow: var(--shadow);
}

.map-open img {
  width: 100%;
  height: auto;
}

.map-figure figcaption,
.key-map figcaption {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.rotate-hint {
  display: none;
}

@media (max-width: 700px) and (orientation: portrait) {
  .rotate-hint {
    display: inline;
  }
}

.seg {
  display: inline-flex;
  margin: 0 0 0.75rem;
  border: 1px solid var(--rule);
}

.seg button {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.8rem;
  min-height: 2.6rem;
  border: 0;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}

.seg button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.maps-index {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 820px) {
  .maps-index {
    grid-template-columns: minmax(240px, 340px) 1fr;
  }
}

.key-map .map-open img {
  max-height: 70vh;
  object-fit: contain;
}

.map-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.map-list a {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.5rem;
  background: var(--card);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

.map-list a:hover {
  border-color: var(--brand-2);
  color: inherit;
}

.map-list img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--rule);
}

.map-list strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--brand);
  line-height: 1.1;
}

.map-list small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.map-list em {
  display: block;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

@media (max-width: 480px) {
  .map-list a {
    grid-template-columns: 6.5rem 1fr;
  }

  .map-list em {
    display: none;
  }
}

/* Full-screen map viewer */
html.zoomer-open,
html.zoomer-open body {
  overflow: hidden;
}

.zoomer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: #0d1216;
}

.zoomer[hidden] {
  display: none !important;
}

.zoomer-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem;
  justify-content: flex-end;
  background: rgba(13, 18, 22, 0.95);
}

.zoomer-bar button {
  font: inherit;
  font-weight: 700;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(243, 246, 248, 0.4);
  background: transparent;
  color: #f3f6f8;
  cursor: pointer;
}

.zoomer-bar .zoomer-close {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1406;
}

.zoomer-stage {
  flex: 1;
  overflow: auto;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.zoomer-stage img {
  width: 100%;
  max-width: none;
  height: auto;
}

.zoomer-hint {
  margin: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  color: #c9d4dc;
  text-align: center;
}

/* —— Industry spot sheets —— */
.jump ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.jump a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  min-height: 2.5rem;
  background: var(--card);
  border: 1px solid var(--rule);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.spot-sheet {
  scroll-margin-top: 5rem;
}

.spot-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.spot-head h2 {
  margin: 0;
}

.spot-meta {
  margin: 0.35rem 0 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.spot-sheet h3 {
  margin: 0.9rem 0 0.35rem;
  font-size: 1rem;
}

.spot-sheet .table-wrap {
  box-shadow: none;
}

.spot-history summary {
  cursor: pointer;
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--brand-2);
}

.two-col {
  display: grid;
  gap: 0 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/* —— Primer photo strip —— */
.arrive-strip {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.arrive-strip figure {
  margin: 0;
}

.arrive-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #1a2229;
}

.arrive-strip figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

.signoff {
  margin-top: 1rem;
  font-family: var(--font-story);
}

.signoff p {
  margin: 0;
}

.job-card a.code {
  text-decoration: none;
}

/* —— Publications shelf —— */
.shelf-group {
  margin: 0 0 1.75rem;
}

.shelf-group > h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  color: var(--brand);
  margin: 0 0 0.5rem;
}

.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.shelf li {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr) auto;
  gap: 0.4rem 0.9rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--rule);
}

.shelf .pub-no {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.shelf .pub-no small {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.shelf h3 {
  margin: 0;
  font-size: 1.02rem;
}

.shelf p {
  margin: 0.1rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.shelf .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.shelf .actions .btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  min-height: 2.4rem;
  font-family: inherit;
  cursor: pointer;
}

@media (max-width: 640px) {
  .shelf li {
    grid-template-columns: 4.6rem minmax(0, 1fr);
  }

  .shelf .actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* —— Guides: rendered Markdown tables —— */
.guide-body .table-wrap {
  margin: 0 0 1rem;
  box-shadow: none;
}

.guide-body hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.5rem 0;
}

/* —— Print —— */
@media print {
  .site-header,
  .site-footer,
  .crumb,
  .no-print,
  .lightbox,
  .zoomer,
  .quote-strip {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 10pt;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .print-only {
    display: block;
  }

  .panel,
  .sheet-more,
  .steps li,
  .seq li,
  .table-wrap,
  .map-open {
    box-shadow: none;
    background: #fff;
  }

  .sheet-more > summary {
    display: none;
  }

  .sheet-more > :not(summary) {
    margin: 0;
  }

  /* 5×8 crew card */
  body.crew-sheet {
    font-size: 9pt;
    line-height: 1.3;
  }

  body.crew-sheet .sheet-head {
    position: static;
    margin: 0 0 0.08in;
    padding: 0 0 0.06in;
    border-bottom-width: 2px;
    gap: 0.05in 0.12in;
  }

  body.crew-sheet .sheet-code {
    font-size: 24pt;
  }

  body.crew-sheet .sheet-head h1 {
    font-size: 13pt;
  }

  body.crew-sheet .sheet-engine img {
    width: 1.3in;
  }

  body.crew-sheet .sheet-summary {
    font-size: 9pt;
    margin-bottom: 0.08in;
  }

  body.crew-sheet .sheet-sec {
    margin-bottom: 0.08in;
    break-inside: avoid;
  }

  body.crew-sheet .sheet-sec h2 {
    font-size: 11pt;
    margin-bottom: 0.03in;
  }

  body.crew-sheet .steps {
    font-size: 9pt;
    gap: 0.02in;
  }

  body.crew-sheet .steps li,
  body.crew-sheet .seq li {
    border: 0;
  }

  body.crew-sheet .steps label {
    grid-template-columns: 0.2in 1fr;
    padding: 0.01in 0;
  }

  body.crew-sheet .steps label::before {
    font-size: 10pt;
  }

  body.crew-sheet .steps span {
    grid-column: 2;
  }

  body.crew-sheet .seq {
    gap: 0.03in;
  }

  body.crew-sheet .seq li {
    padding: 0.02in 0;
    grid-template-columns: 0.22in 1fr;
  }

  body.crew-sheet .seq-train,
  body.crew-sheet .seq-n {
    font-size: 10pt;
  }

  body.crew-sheet .seq-action {
    font-size: 9pt;
  }

  body.crew-sheet .cc-list {
    grid-template-columns: 1fr 1fr;
    gap: 0.03in 0.1in;
  }

  body.crew-sheet .cc-list li {
    grid-template-columns: 0.75in minmax(0, 1fr);
    gap: 0.05in;
    font-size: 8pt;
  }

  body.crew-sheet .cc-list small,
  body.crew-sheet .sheet-colors .muted {
    display: none;
  }

  body.crew-sheet .cchip {
    min-width: 0;
    font-size: 7.5pt;
    padding: 0.01in 0.04in;
  }

  body.crew-sheet .cchip.is-dim {
    opacity: 0.35;
  }

  body.crew-sheet a {
    color: inherit;
    text-decoration: none;
  }

  body.crew-sheet .prio-strip {
    gap: 0.03in 0;
    margin-bottom: 0.02in;
  }

  body.crew-sheet .prio-strip li {
    font-size: 8.5pt;
  }

  body.crew-sheet .prio-strip li span {
    padding: 0.01in 0.05in;
  }

  body.crew-sheet .prio-strip li:not(:last-child)::after {
    margin: 0 0.03in;
  }

  body.crew-sheet .sheet-sec .small {
    font-size: 7.5pt;
    margin: 0;
  }

  body.crew-sheet .seq-chips {
    margin-top: 0.01in !important;
    gap: 0.02in;
  }

  body.crew-sheet .tt-note {
    font-size: 7pt;
  }

  body.crew-sheet .print-back {
    break-before: page;
    border: 0;
  }

  body.crew-sheet .back-page {
    display: grid;
    grid-template-columns: 1.9in 1fr;
    gap: 0.15in;
    align-items: start;
  }

  body.crew-sheet .back-map img {
    width: 100%;
    max-height: 6.8in;
    object-fit: contain;
  }

  body.crew-sheet .back-map {
    margin: 0;
  }

  body.crew-sheet .tt-table {
    font-size: 7.5pt;
  }

  body.crew-sheet .tt-table th,
  body.crew-sheet .tt-table td {
    padding: 0.02in 0.04in;
  }

  table.data-table thead th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Station map: image only */
  body.crew-map main > :not(#crew-root),
  body.crew-map #crew-root > :not(.map-figure) {
    display: none !important;
  }

  body.crew-map .map-open {
    border: 0;
  }

  body.crew-map .map-figure {
    margin: 0;
  }

  body.crew-map main {
    padding: 0;
  }

  body.crew-map .map-figure {
    break-inside: avoid;
  }

  body.crew-map .map-figure img {
    width: auto;
    max-width: 100%;
    max-height: 4.6in;
    margin: 0 auto;
    object-fit: contain;
  }
}
