:root {
  --navy: #17324d;
  --navy-dark: #102438;
  --blue: #2d638f;
  --blue-light: #e8f0f6;
  --ink: #20272d;
  --muted: #5b6873;
  --line: #cbd3d9;
  --line-dark: #9daab3;
  --paper: #ffffff;
  --ground: #eef1f3;
  --caution: #986b00;
  --caution-bg: #fff7dd;
  --good: #39704f;
  --content: 1240px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.55; }
img { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.16em; }
a:hover { color: var(--navy-dark); }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.6rem 0.8rem;
  color: white;
  background: var(--navy-dark);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.site-header {
  color: white;
  background: var(--navy);
  border-bottom: 4px solid #7695ae;
}

.header-main,
.site-header nav,
.page-header,
.status-band,
.manual-grid,
.site-footer {
  width: min(calc(100% - 40px), var(--content));
  margin-inline: auto;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  min-height: 104px;
  padding-block: 1.25rem;
}

.identity { color: white; text-decoration: none; }
.registration { display: block; font-size: 2rem; font-weight: 700; letter-spacing: 0.08em; line-height: 1.1; }
.aircraft-type { display: block; margin-top: 0.2rem; color: #d8e3ec; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.document-meta { display: grid; gap: 0.2rem; color: #d8e3ec; font-size: 0.75rem; text-align: right; }

.site-header nav { display: flex; overflow-x: auto; }
.site-header nav a {
  flex: 0 0 auto;
  padding: 0.8rem 1.2rem;
  border-left: 1px solid rgb(255 255 255 / 0.16);
  color: #eef5fa;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-header nav a:first-child { border-left: 0; }
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--navy-dark); background: white; }

main { min-height: 70vh; }
.page-header { padding-block: 3.25rem 2.5rem; }
.section-code { margin: 0 0 0.55rem; color: var(--blue); font-size: 0.73rem; font-weight: 700; letter-spacing: 0.12em; }
h1, h2, h3 { color: var(--navy-dark); line-height: 1.18; }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.35rem); font-weight: 650; letter-spacing: -0.025em; }
h2 { margin: 2.2rem 0 0.8rem; font-size: 1.45rem; }
h3 { margin: 1.7rem 0 0.5rem; font-size: 1.1rem; }
.lede { max-width: 850px; margin: 1rem 0 0; color: var(--muted); font-size: 1.08rem; }

.status-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 2rem;
  border: 1px solid var(--line-dark);
  background: var(--paper);
}
.status-band > div { min-width: 0; padding: 1rem 1.15rem; border-left: 1px solid var(--line); }
.status-band > div:first-child { border-left: 0; }
.status-band span { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.status-band strong { display: block; color: var(--navy-dark); font-size: 0.98rem; }
.status-band .status-caution { color: var(--caution); }

.manual-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-bottom: 5rem;
}

.notice {
  padding: 1.15rem;
  border-top: 4px solid var(--blue);
  background: var(--blue-light);
  color: #334857;
  font-size: 0.82rem;
}
.notice h2 { margin: 0 0 0.5rem; font-size: 0.83rem; letter-spacing: 0.06em; text-transform: uppercase; }
.notice p { margin: 0; }
.notice-caution { border-color: #d39b15; background: var(--caution-bg); }
.notice-caution h2 { color: #684b05; }

.document-body {
  min-width: 0;
  padding: 1.5rem clamp(1.2rem, 3vw, 3rem) 3rem;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 2px 8px rgb(20 43 60 / 0.05);
}
.document-body > section:first-child h2,
.document-body > h2:first-child { margin-top: 0; }
.document-body p,
.document-body li { color: #3d4952; }
.document-body p { margin: 0 0 1.15rem; }
.document-body strong { color: var(--ink); }
.document-body h2 { margin-top: 2.8rem; padding-bottom: 0.45rem; border-bottom: 2px solid var(--navy); }
.document-body h3 { padding-left: 0.7rem; border-left: 3px solid #82a4bd; }
.document-body ol,
.document-body ul { padding-left: 1.35rem; }
.document-body li + li { margin-top: 0.4rem; }

.section-list { display: grid; margin-top: 1rem; border: 1px solid var(--line); }
.section-list a {
  display: grid;
  grid-template-columns: 46px minmax(170px, 0.5fr) minmax(250px, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 1rem;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.section-list a:first-child { border-top: 0; }
.section-list a:hover { background: #f3f7fa; }
.section-list span { color: var(--blue); font-size: 0.78rem; font-weight: 700; }
.section-list strong { color: var(--navy-dark); }
.section-list small { color: var(--muted); font-size: 0.82rem; }

table { display: block; width: 100%; margin: 1.2rem 0 2rem; border-collapse: collapse; overflow-x: auto; font-size: 0.86rem; }
thead { color: white; background: var(--navy); }
th { font-weight: 700; text-align: left; }
th, td { min-width: 115px; padding: 0.7rem 0.75rem; border: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) { background: #f5f7f8; }

blockquote { margin: 1.5rem 0; padding: 1rem 1.15rem; border-left: 4px solid #d39b15; background: var(--caution-bg); }
blockquote p { margin: 0; color: #4c431f; }

.legend { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; padding: 1rem; border: 1px solid var(--line); background: #f6f8f9; font-size: 0.8rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--good); }
.legend i.probable { background: #d39b15; }
.legend i.proposed { background: var(--blue); }

.diagram { margin: 1.7rem 0 2rem; padding: 1rem; border: 1px solid var(--line); background: white; overflow-x: auto; }
.diagram img { min-width: 720px; margin: auto; }
.diagram figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.75rem; text-align: center; }

.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); margin: 1.4rem 0; border: 1px solid var(--line-dark); }
.metric-grid > div { padding: 1rem; border-left: 1px solid var(--line); text-align: center; }
.metric-grid > div:first-child { border-left: 0; }
.metric-grid strong { display: block; color: var(--navy); font-size: 1.65rem; line-height: 1.1; }
.metric-grid span { display: block; margin-top: 0.45rem; color: var(--muted); font-size: 0.75rem; line-height: 1.35; }

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line-dark);
  color: var(--muted);
  font-size: 0.75rem;
}
.site-footer p { margin: 0; }

@media (max-width: 900px) {
  .status-band { grid-template-columns: 1fr 1fr; }
  .status-band > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .status-band > div:nth-child(4) { border-top: 1px solid var(--line); }
  .manual-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid > div { border-top: 1px solid var(--line); }
  .metric-grid > div:nth-child(odd) { border-left: 0; }
  .metric-grid > div:first-child,
  .metric-grid > div:nth-child(2) { border-top: 0; }
}

@media (max-width: 620px) {
  .header-main, .page-header, .status-band, .manual-grid, .site-footer { width: min(calc(100% - 24px), var(--content)); }
  .header-main { align-items: start; flex-direction: column; min-height: auto; gap: 0.8rem; }
  .document-meta { text-align: left; }
  .site-header nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    padding: 0;
    overflow: visible;
  }
  .site-header nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.7rem 0.8rem;
    border-top: 1px solid rgb(255 255 255 / 0.16);
    border-left: 1px solid rgb(255 255 255 / 0.16);
    font-size: 0.68rem;
  }
  .site-header nav a:first-child { border-left: 1px solid rgb(255 255 255 / 0.16); }
  .site-header nav a:last-child { grid-column: 1 / -1; }
  .page-header { padding-block: 2.5rem 2.2rem; }
  .page-header h1 { font-size: 2.1rem; line-height: 1.14; }
  .page-header .lede { margin-top: 1.15rem; font-size: 1rem; line-height: 1.7; }
  .status-band { grid-template-columns: 1fr; }
  .status-band > div { padding: 1.15rem; border-top: 1px solid var(--line); border-left: 0; }
  .status-band > div:first-child { border-top: 0; }
  .manual-grid { gap: 1.5rem; padding-bottom: 3rem; }
  .notice { padding: 1.15rem; font-size: 0.86rem; line-height: 1.7; }
  .document-body { padding: 1.4rem 1rem 2.4rem; }
  .document-body h2 { margin-top: 3rem; margin-bottom: 1.1rem; font-size: 1.42rem; line-height: 1.22; }
  .document-body h2:first-child { margin-top: 0; }
  .document-body h3 { margin-top: 2.1rem; font-size: 1.08rem; line-height: 1.3; }
  .document-body p,
  .document-body li { font-size: 0.96rem; line-height: 1.72; }
  .document-body p { margin-bottom: 1.3rem; }
  .document-body ol,
  .document-body ul { padding-left: 1.45rem; }
  .document-body li + li { margin-top: 0.75rem; }
  .section-list a { display: block; padding: 1.15rem; }
  .section-list span { display: block; margin-bottom: 0.35rem; }
  .section-list strong { display: block; font-size: 1rem; line-height: 1.35; }
  .section-list small { display: block; margin-top: 0.45rem; line-height: 1.55; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid > div { min-height: 112px; padding: 1rem 0.6rem; }
  .metric-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .metric-grid strong { font-size: 1.45rem; }
  .legend { display: grid; gap: 0.8rem; }

  table {
    display: block;
    margin: 1.5rem 0 2.5rem;
    overflow: visible;
    font-size: 0.9rem;
  }
  table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  table tbody { display: grid; gap: 1rem; }
  table tr {
    display: block;
    border: 1px solid var(--line-dark);
    border-top: 4px solid var(--navy);
    background: white;
  }
  table td {
    display: block;
    min-width: 0;
    padding: 0.75rem 0.85rem;
    border: 0;
    border-top: 1px solid var(--line);
    color: #34414a;
    line-height: 1.55;
  }
  table td:first-child {
    border-top: 0;
    color: var(--navy-dark);
    background: #f1f5f8;
    font-weight: 700;
  }
  table td::before {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--blue);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  body[data-page="/"] table:nth-of-type(1) td:nth-child(1)::before { content: "Area"; }
  body[data-page="/"] table:nth-of-type(1) td:nth-child(2)::before { content: "Present position"; }
  body[data-page="/"] table:nth-of-type(1) td:nth-child(3)::before { content: "Action"; }

  body[data-page="/aircraft/"] table:nth-of-type(1) td:nth-child(1)::before { content: "Reference"; }
  body[data-page="/aircraft/"] table:nth-of-type(1) td:nth-child(2)::before { content: "Item"; }
  body[data-page="/aircraft/"] table:nth-of-type(1) td:nth-child(3)::before { content: "Status"; }
  body[data-page="/aircraft/"] table:nth-of-type(1) td:nth-child(4)::before { content: "Required disposition"; }

  body[data-page="/equipment/"] table:nth-of-type(1) td:nth-child(1)::before { content: "Equipment"; }
  body[data-page="/equipment/"] table:nth-of-type(1) td:nth-child(2)::before { content: "Function"; }
  body[data-page="/equipment/"] table:nth-of-type(1) td:nth-child(3)::before { content: "Limitation or check"; }
  body[data-page="/equipment/"] table:nth-of-type(2) td:nth-child(1)::before { content: "Function"; }
  body[data-page="/equipment/"] table:nth-of-type(2) td:nth-child(2)::before { content: "Present equipment"; }
  body[data-page="/equipment/"] table:nth-of-type(2) td:nth-child(3)::before { content: "Confidence"; }
  body[data-page="/equipment/"] table:nth-of-type(2) td:nth-child(4)::before { content: "Value"; }

  body[data-page="/ifr-plan/"] table:nth-of-type(1) td:nth-child(1)::before { content: "Function"; }
  body[data-page="/ifr-plan/"] table:nth-of-type(1) td:nth-child(2)::before { content: "Why it matters"; }
  body[data-page="/ifr-plan/"] table:nth-of-type(1) td:nth-child(3)::before { content: "Present coverage"; }
  body[data-page="/ifr-plan/"] table:nth-of-type(1) td:nth-child(4)::before { content: "Next action"; }
  body[data-page="/ifr-plan/"] table:nth-of-type(2) td:nth-child(1)::before { content: "Priority"; }
  body[data-page="/ifr-plan/"] table:nth-of-type(2) td:nth-child(2)::before { content: "Work"; }
  body[data-page="/ifr-plan/"] table:nth-of-type(2) td:nth-child(3)::before { content: "Reason"; }
  body[data-page="/ifr-plan/"] table:nth-of-type(3) td:nth-child(1)::before { content: "Item"; }
  body[data-page="/ifr-plan/"] table:nth-of-type(3) td:nth-child(2)::before { content: "Assessment"; }

  body[data-page="/aerodromes/"] table:nth-of-type(1) td:nth-child(1)::before { content: "Published capability"; }
  body[data-page="/aerodromes/"] table:nth-of-type(1) td:nth-child(2)::before { content: "Aerodromes"; }
  body[data-page="/aerodromes/"] table:nth-of-type(1) td:nth-child(3)::before { content: "Proportion"; }
  body[data-page="/aerodromes/"] table:nth-of-type(2) td:nth-child(1)::before { content: "Aerodrome"; }
  body[data-page="/aerodromes/"] table:nth-of-type(2) td:nth-child(2)::before { content: "ILS"; }
  body[data-page="/aerodromes/"] table:nth-of-type(2) td:nth-child(3)::before { content: "GNSS / RNP"; }
  body[data-page="/aerodromes/"] table:nth-of-type(2) td:nth-child(4)::before { content: "Other options"; }
  body[data-page="/aerodromes/"] table:nth-of-type(2) td:nth-child(5)::before { content: "Implication"; }

  .site-footer { grid-template-columns: 1fr; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  :root { background: white; }
  .site-header nav { display: none; }
  .manual-grid { display: block; }
  .notice { margin-bottom: 1rem; }
  .document-body { border: 0; box-shadow: none; }
  .site-footer { page-break-before: always; }
}
