:root {
  --accent: #ee4f2b;        /* HeliStorm orange-red */
  --ink: #1c1c1e;
  --muted: #6b6b70;
  --page-bg: #faf9f7;
  --card-bg: #ffffff;
  --card-border: #e7e4df;
  --chip-bg: #ededf0;
  --panel: #4b4b4d;         /* charcoal bullet panel */
  --k-green: #8ce05a;
  --pill-blue: #cfe6fb;  --pill-blue-ink: #1d5e90;
  --pill-red: #fbd6d6;   --pill-red-ink: #b03030;
  --pill-amber: #fbeccb; --pill-amber-ink: #9a6a12;
  --pill-pink: #fbd6e2;  --pill-pink-ink: #b03060;
  --maxw: 820px;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page-bg); color: var(--ink);
  font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased;
}

/* ── top nav ── */
.topnav {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; row-gap: 12px;
  padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 10;
}
.topnav__brand { flex: 0 0 auto; display: inline-flex; align-items: center; }
.topnav__logo { height: 28px; width: auto; display: block; }
.topnav__pkg { margin-left: auto; font-weight: 800; color: var(--ink); white-space: nowrap; letter-spacing: -.01em; font-size: 18px; }
.pagefoot__brand { letter-spacing: -.01em; }
.brand-heli { color: var(--accent); }
.topnav__links { order: 3; width: 100%; display: flex; align-items: center; gap: 18px; padding-top: 12px; border-top: 1px solid var(--card-border); }
.topnav__links a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.topnav__links a:hover { color: var(--accent); }
.topnav__print { margin-left: auto; border: 0; background: var(--accent); color: #fff; font-weight: 700; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap; text-decoration: none; display: inline-block; }
@media (max-width: 600px) {
  .topnav { padding: 10px 16px; }
  .topnav__logo { height: 24px; }
  .topnav__pkg { font-size: 16px; }
  .topnav__links { gap: 10px; padding-top: 10px; }
  .topnav__links a { font-size: 13px; }
  .topnav__print { padding: 7px 12px; font-size: 12px; }
}

.page { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 80px; }

/* ── cover + toc ── */
.cover { text-align: center; padding: 80px 0 40px; }
.cover__kicker { color: var(--accent); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; margin: 0; }
.cover__title { font-size: 48px; font-weight: 850; margin: 10px 0 6px; letter-spacing: -.02em; line-height: 1.05; }
.cover__version { color: var(--muted); margin: 0; }
.toc { background: #fff; border: 1px solid var(--card-border); border-radius: 14px; padding: 24px 28px; }
.toc__head { margin: 0 0 12px; font-size: 18px; }
.toc__list { margin: 0; padding-left: 20px; line-height: 2; }
.toc__list a { color: var(--ink); text-decoration: none; font-weight: 600; }
.toc__list a:hover { color: var(--accent); }

/* ── intro letter ── */
.letter { background: #fff; border: 1px solid var(--card-border); border-radius: 16px; padding: 32px 36px; margin: 12px 0 32px; }
.letter__eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; margin: 0 0 14px; }
.letter p { margin: 0 0 16px; }
.letter__sig { height: 56px; width: auto; display: block; margin: 6px 0 2px; }
.letter__name { font-weight: 700; margin-top: 4px; }
.letter__name span { font-weight: 400; color: var(--muted); }

/* ── §5 LiveJudge device frames ── */
.lj-grid { display: grid; gap: 22px; margin-top: 8px; }
.lj-grid--phone { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lj-grid--desktop { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.lj-shot { margin: 0; }
.lj-shot figcaption { margin-top: 10px; text-align: center; font-size: 13px; color: var(--muted); }

.frame--phone { background: #111; border-radius: 26px; padding: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.frame--phone img,
.frame--phone .frame__placeholder { width: 100%; aspect-ratio: 9 / 19.5; object-fit: contain; background: #000; border-radius: 18px; display: block; }

.frame--desktop { position: relative; border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden; background: #fff; padding-top: 30px; box-shadow: 0 4px 14px rgba(0,0,0,.07); }
.frame--desktop::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 30px; background: #f3f3f5; border-bottom: 1px solid var(--card-border); }
.frame--desktop::after { content: ""; position: absolute; top: 11px; left: 14px; width: 8px; height: 8px; border-radius: 50%; background: #ff5f57; box-shadow: 14px 0 #febc2e, 28px 0 #28c840; }
.frame--desktop img,
.frame--desktop .frame__placeholder { width: 100%; display: block; }
.frame--desktop .frame__placeholder { aspect-ratio: 16 / 10; }

.frame__placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #9a9a9a; background: #f6f6f7; border: 2px dashed #d3d3d6; }
.frame--phone .frame__placeholder { background: #1a1a1a; border-color: #333; color: #888; }
.frame__placeholder span { font-weight: 700; font-size: 13px; }
.frame__placeholder code { font-size: 11px; opacity: .8; }

/* ── section header ── */
.section-head { display: flex; gap: 18px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--card-border); margin: 36px 0 24px; }
.section-badge {
  flex: 0 0 auto; width: 74px; height: 56px; border-radius: 12px; background: var(--accent);
  color: #fff; font-weight: 850; font-size: 26px; display: grid; place-items: center; letter-spacing: -.02em;
}
.section-eyebrow { margin: 2px 0 2px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.section-title { margin: 0 0 6px; font-size: 30px; font-weight: 850; letter-spacing: -.02em; line-height: 1.12; }
.section-subtitle { margin: 0; color: var(--muted); max-width: 60ch; }

/* ── rule cards ── */
.rule-list { display: flex; flex-direction: column; gap: 16px; }
.rule-card { display: flex; gap: 16px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.rule-num { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; background: var(--chip-bg); color: #444; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.rule-title { margin: 2px 0 6px; font-size: 17px; font-weight: 800; }
.rule-text { margin: 0; color: #2c2c2e; }
.pill { display: inline-block; margin-top: 12px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill--blue { background: var(--pill-blue); color: var(--pill-blue-ink); }
.pill--red { background: var(--pill-red); color: var(--pill-red-ink); }
.pill--amber { background: var(--pill-amber); color: var(--pill-amber-ink); }
.pill--pink { background: var(--pill-pink); color: var(--pill-pink-ink); }
.pill--green { background: #d3f0cf; color: #2f7a2a; }

/* ── §4.1 scoring rubric ── */
.rubric-class { margin: 22px 0 10px; }
.rubric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rubric-card { background: #fff; border: 1px solid var(--card-border); border-radius: 14px; padding: 20px; }
.rubric-card__name { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.rubric-card__desc { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.rubric-card__label { margin: 16px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.rubric-protocol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rubric-protocol div { border: 1px solid var(--card-border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.rubric-protocol span { font-size: 10px; color: var(--muted); }
.rubric-protocol strong { font-size: 13px; }
.factor-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.factor { display: flex; align-items: center; gap: 10px; border: 1px solid var(--card-border); border-radius: 10px; padding: 8px 10px; }
.factor__type { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.factor__type--m { background: #2e8b3d; }
.factor__type--f { background: #3aa0e0; }
.factor__name { flex: 1; font-size: 13px; font-weight: 600; }
.factor__weight { flex: 0 0 auto; color: var(--muted); font-weight: 700; font-size: 13px; }

/* ── §4.2 maneuver catalog ── */
.catalog-tier { margin-top: 22px; }
.catalog-tier__head { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 0 0 12px; }
.swatch { width: 18px; height: 18px; border-radius: 5px; display: inline-block; }
.swatch--green { background: #36c93c; } .swatch--blue { background: #2f9ae8; }
.swatch--red { background: #f0593f; } .swatch--amber { background: #f5b827; }
.catalog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.catalog-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--card-border); border-radius: 10px; padding: 12px 14px; }
.catalog-item__name { font-weight: 700; font-size: 14px; }
.k-pill { flex: 0 0 auto; color: #fff; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 7px; }
.k-pill--green { background: #36c93c; } .k-pill--blue { background: #2f9ae8; }
.k-pill--red { background: #f0593f; } .k-pill--amber { background: #f5b827; }

/* ── §4.3 static criteria ── */
.criteria-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.criterion { background: #fff; border: 1px solid var(--card-border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; }
.criterion__title { margin: 0 0 10px; font-size: 15px; font-weight: 800; }
.criterion__body { margin: 0 0 16px; font-size: 13px; color: #2c2c2e; }
.criterion__scope { margin-top: auto; align-self: flex-end; }

@media (max-width: 680px) {
  .rubric-grid, .catalog-grid, .criteria-grid { grid-template-columns: 1fr; }
}

/* ── section figure (e.g. flight layout reference) ── */
.section-figure { margin: 0 0 24px; }
.section-figure img { width: 100%; height: auto; display: block; border: 1px solid var(--card-border); border-radius: 14px; }
.section-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; text-align: center; }

/* ── maneuver: phase-1 image grid ── */
.maneuver-grid { display: grid; gap: 22px; }
.maneuver--image { background: #fff; border: 1px solid var(--card-border); border-radius: 14px; overflow: hidden; }
.maneuver__svg { width: 100%; height: auto; display: block; }

/* ── maneuver: data-driven card ── */
.demo-note { background: #fff7ed; border: 1px solid #f4d9b8; border-radius: 12px; padding: 14px 16px; color: #7a4e16; }
.demo-note code { background: #f1e6d4; padding: 1px 5px; border-radius: 4px; }
.maneuver--card { background: #fff; border: 1px solid var(--card-border); border-radius: 16px; padding: 22px; }
.maneuver__head { display: flex; justify-content: space-between; align-items: center; }
.maneuver__title { margin: 0; font-size: 26px; font-weight: 850; text-transform: uppercase; letter-spacing: .02em; }
.maneuver__body { display: grid; grid-template-columns: 1fr 280px; gap: 20px; margin-top: 16px; align-items: stretch; }
.maneuver__art { position: relative; background: #fff; border-radius: 12px; min-height: 360px; }
.art-svg { width: 100%; height: auto; }
.dim-label { fill: #9a9a9a; font: 700 28px var(--font); }
.timer { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-weight: 800; color: #555; }
.maneuver__panel { background: var(--panel); border-radius: 16px; padding: 22px; color: #fff; display: flex; flex-direction: column; }
.maneuver__bullets { margin: 0 0 auto; padding-left: 18px; }
.maneuver__bullets li { margin-bottom: 14px; line-height: 1.45; }
.k-badge { align-self: flex-end; margin-top: 18px; background: var(--k-green); color: #143d06; font-weight: 850; padding: 8px 16px; border-radius: 10px; }

/* walk/run badge */
.walk-badge { display: inline-flex; gap: 4px; background: #111; border-radius: 999px; padding: 8px 12px; margin-top: 14px; }
.walk-step { display: flex; flex-direction: column; align-items: center; padding: 2px 12px; color: #9a9a9a; font-size: 10px; font-weight: 700; }
.walk-step.is-active { color: var(--accent); }
.walk-icon { font-size: 18px; }

/* maneuver index table */
.table-head { margin: 36px 0 10px; font-size: 18px; }
.maneuver-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.maneuver-table th, .maneuver-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--card-border); }
.maneuver-table th { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }

/* footer */
.pagefoot { max-width: var(--maxw); margin: 0 auto; padding: 20px 24px 40px; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.pagefoot__brand { font-weight: 800; }

@media (max-width: 680px) {
  .maneuver__body { grid-template-columns: 1fr; }
}
