:root {
  --navy: #071a2d;
  --navy-2: #0e2a46;
  --ink: #13283f;
  --muted: #617287;
  --paper: #f4f7fa;
  --white: #ffffff;
  --line: #d7e0e8;
  --soft: #eaf4f3;
  --teal: #0f766e;
  --teal-2: #dff5f2;
  --yellow: #f4c84a;
  --yellow-soft: #fff6d8;
  --danger: #9f3636;
  --danger-soft: #fff0ef;
  --radius: 14px;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.58 "Segoe UI", Arial, Helvetica, sans-serif;
}

a { color: inherit; }
button, input, select { font: inherit; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: white;
  background: rgba(7, 26, 45, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(16px);
}

.header-row {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: 850;
  letter-spacing: -.025em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--navy);
  background: var(--yellow);
  font-weight: 950;
}

.global-nav { display: flex; align-items: center; gap: 4px; }
.global-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  color: #c8d5e2;
  font-size: .86rem;
  font-weight: 650;
  text-decoration: none;
}
.global-nav a:hover, .global-nav a:focus-visible { color: white; background: rgba(255, 255, 255, .09); outline: none; }

.page-nav {
  border-bottom: 1px solid var(--line);
  background: white;
}

.page-nav .shell {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.page-nav a {
  flex: 0 0 auto;
  padding: 12px 10px 10px;
  border-bottom: 3px solid transparent;
  color: #4d6075;
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
}
.page-nav a:hover, .page-nav a:focus-visible { color: var(--teal); border-color: var(--teal); outline: none; }

main { padding: 34px 0 72px; }

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 18px;
  align-items: stretch;
}

.intro-main, .intro-aside, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.intro-main { padding: clamp(26px, 4vw, 44px); }
.intro-aside { padding: 24px; background: var(--navy); color: white; }

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.intro-aside .eyebrow { color: #85e1d9; }

h1, h2, h3, h4 { color: inherit; line-height: 1.15; }
h1 { max-width: 860px; margin: 8px 0 14px; font-size: clamp(2.2rem, 5vw, 4.15rem); letter-spacing: -.055em; }
h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.035em; }
h3 { margin: 0; font-size: 1.08rem; }
p { margin: 0; }
.lede { max-width: 780px; color: var(--muted); font-size: 1.04rem; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #40566c;
  background: #eef2f6;
  font-size: .75rem;
  font-weight: 750;
}
.tag.teal { color: #075e58; background: var(--teal-2); }
.tag.yellow { color: #725700; background: var(--yellow-soft); }

.fact-list { margin: 14px 0 0; padding: 0; list-style: none; }
.fact-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .13);
  font-size: .84rem;
}
.fact-list span { color: #aebfd0; }
.fact-list b { text-align: right; }
.intro-note { margin-top: 15px; color: #aebfd0; font-size: .77rem; }

.section { margin-top: 54px; scroll-margin-top: 118px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}
.section-head p { max-width: 750px; margin-top: 8px; color: var(--muted); }
.section-note { max-width: 320px; color: #718196; font-size: .8rem; text-align: right; }

.panel { padding: 22px; }
.panel + .panel { margin-top: 12px; }
.panel-title { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.panel-title p { margin-top: 6px; color: var(--muted); font-size: .9rem; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.summary-item {
  min-height: 94px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}
.summary-item b { display: block; font-size: 1.25rem; }
.summary-item span { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.field label { display: block; margin-bottom: 6px; color: #445b71; font-size: .78rem; font-weight: 800; }
.field input {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid #b8c7d5;
  border-radius: 9px;
  color: var(--ink);
  background: white;
  outline: none;
}
.field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .13); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  min-height: 37px;
  padding: 7px 10px;
  border: 1px solid #b9c8d5;
  border-radius: 8px;
  color: #445b71;
  background: white;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.filter:hover, .filter.active { color: white; border-color: var(--teal); background: var(--teal); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
  padding: 11px 13px;
  color: #50657a;
  background: #edf2f6;
  font-size: .72rem;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
}
.data-table td { padding: 13px; border-top: 1px solid var(--line); vertical-align: top; font-size: .86rem; }
.data-table tbody tr:hover { background: #f8fbfc; }
.data-table td:first-child { font-weight: 850; color: var(--navy-2); }
.data-table .muted { color: var(--muted); }
.data-table a { color: var(--teal); font-weight: 800; }

.list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.list li { position: relative; padding-left: 22px; color: #40566c; }
.list li::before { content: ""; position: absolute; left: 1px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.compact-card { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.compact-card h3 { margin-top: 4px; }
.compact-card p { margin-top: 8px; color: var(--muted); font-size: .84rem; }
.compact-card strong { display: block; margin-top: 10px; color: var(--teal); font-size: .78rem; }

.details-list { display: grid; gap: 9px; }
details {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}
details[hidden] { display: none; }
summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary:focus-visible { outline: 3px solid rgba(15, 118, 110, .2); outline-offset: -3px; }
.index-number {
  min-width: 42px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 8px;
  color: var(--navy);
  background: var(--yellow);
  font-size: .78rem;
  font-weight: 950;
}
.summary-copy b { display: block; }
.summary-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: .77rem; }
.summary-plus { color: var(--teal); font-size: 1.2rem; font-weight: 850; }
details[open] .summary-plus { transform: rotate(45deg); }
.detail-body { padding: 0 16px 16px 70px; border-top: 1px solid var(--line); }
.detail-body p { margin-top: 13px; color: #40566c; }
.detail-body .tags { margin-top: 12px; }

.stage-list { display: grid; gap: 12px; }
.stage { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.stage-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(230px, .55fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  background: var(--navy);
  color: white;
}
.stage-number { color: var(--navy); background: var(--yellow); }
.stage-head p { margin-top: 4px; color: #b7c6d5; font-size: .82rem; }
.stage-outcome { padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .2); color: #d9e4ee; font-size: .78rem; }
.stage-table { width: 100%; border-collapse: collapse; }
.stage-table th { padding: 10px 13px; color: #566a7e; background: #edf2f6; font-size: .69rem; text-align: left; text-transform: uppercase; }
.stage-table td { padding: 11px 13px; border-top: 1px solid var(--line); font-size: .82rem; vertical-align: top; }
.stage-table tr.subject-hidden { display: none; }
.stage-table td:nth-child(1) { width: 28%; font-weight: 800; }
.stage-table td:nth-child(2) { width: 18%; }
.stage-table td:nth-child(3), .stage-table td:nth-child(4) { color: var(--muted); }
.stage.stage-hidden { display: none; }

.chain-list { display: grid; gap: 8px; }
.chain {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.chain b { color: var(--teal); }
.chain span { color: #53687c; font-size: .85rem; }

.notice {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #e6cf7a;
  border-radius: 11px;
  color: #5e4b08;
  background: var(--yellow-soft);
  font-size: .86rem;
}
.notice.warning { border-color: #e8b7b3; color: #742c2c; background: var(--danger-soft); }

.empty { display: none; padding: 20px; color: var(--muted); text-align: center; }
.result-line { margin: 10px 2px 14px; color: var(--muted); font-size: .8rem; }

footer { border-top: 1px solid var(--line); background: white; }
.footer-row { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 18px; color: var(--muted); font-size: .82rem; }
.footer-row a { color: var(--teal); font-weight: 750; }

@media (max-width: 920px) {
  .global-nav a:not(.keep) { display: none; }
  .page-intro, .split { grid-template-columns: 1fr; }
  .summary-grid, .compact-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .section-note { max-width: none; text-align: left; }
  .stage-head { grid-template-columns: auto 1fr; }
  .stage-outcome { grid-column: 1 / -1; padding: 10px 0 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .2); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 1180px); }
  .header-row { min-height: 60px; }
  .brand-mark { width: 31px; height: 31px; }
  main { padding-top: 22px; }
  .intro-main, .intro-aside, .panel { padding: 19px; }
  h1 { font-size: 2.35rem; }
  .summary-grid, .compact-grid { grid-template-columns: 1fr; }
  .detail-body { padding-left: 16px; }
  .chain { grid-template-columns: 1fr; gap: 4px; }
  .stage { overflow-x: auto; }
  .stage-head { min-width: 720px; }
  .stage-table { min-width: 720px; }
  .footer-row { padding: 20px 0; align-items: start; flex-direction: column; }
}
