:root {
  --navy: #0f2230;
  --navy-2: #16364a;
  --ink: #1d2a33;
  --muted: #5b6b76;
  --line: #dde5ea;
  --accent: #2f8fb8;
  --accent-soft: #e8f4fa;
  --pin: #f26a1b;
  --amber: #f0a420;
  --red: #d93a2b;
  --bg: #ffffff;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body { margin: 0; background: var(--bg); }
/* Element rules are scoped to the guide so they leave the site header alone.
   :where() adds no specificity, so the class rules below still win as before. */
.guide {
  display: block; color: var(--ink);
  font: 400 10pt/1.5 Inter, -apple-system, "Helvetica Neue", Arial, sans-serif;
  counter-reset: pg;
}
:where(.guide) a { color: var(--accent); text-decoration: none; }
:where(.guide) p { margin: 0 0 .7em; }
:where(.guide) ul, :where(.guide) ol { margin: 0 0 .8em; padding-left: 1.2em; }
:where(.guide) ul { list-style: disc; }
:where(.guide) ol { list-style: decimal; }
:where(.guide) li { margin-bottom: .3em; }
:where(.guide) img { max-width: 100%; display: block; }
:where(.guide) b, :where(.guide) strong { font-weight: 600; }
:where(.guide) h1, :where(.guide) h2, :where(.guide) h3 { text-wrap: wrap; }

/* ---------- pages ---------- */
@page { size: letter; margin: 0; }
.page {
  position: relative; width: 8.5in; height: 11in; overflow: hidden;
  padding: .65in .7in .8in; break-after: page; counter-increment: pg;
}
.folio {
  position: absolute; left: .7in; right: .7in; bottom: .4in;
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--line); padding-top: 6px;
  font-size: 7.5pt; color: var(--muted);
}
.folio::before { content: "iFly Weight & Balance · User Guide"; }
.folio::after { content: counter(pg); font-weight: 600; color: var(--ink); }

/* ---------- type ---------- */
.eyebrow {
  font: 500 7.5pt/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
.eyebrow.light { color: #7cc6e6; }
:where(.guide) h1, :where(.guide) h2, :where(.guide) h3 { color: var(--navy); margin: 0 0 .4em; letter-spacing: -.01em; }
:where(.guide) h2 { font-size: 20pt; line-height: 1.15; font-weight: 700; }
:where(.guide) h3 { font-size: 11.5pt; font-weight: 600; }
.mt { margin-top: 1.1em; }
.lede { font-size: 11.5pt; color: var(--muted); max-width: 6in; }
.lede.light { color: #c4d3dc; }
.badge {
  display: inline-block; background: var(--pin); color: #fff; border-radius: 99px;
  padding: 2px 7px; margin-left: 4px; letter-spacing: .08em;
}

/* ---------- cover ---------- */
.cover { background: radial-gradient(120% 90% at 85% 30%, #1b4560 0%, var(--navy) 60%); color: #fff; }
.cover-brand { display: flex; flex-direction: column; gap: 2px; margin-bottom: .6in; }
.logo { font-size: 20pt; font-weight: 700; letter-spacing: -.02em; color: #fff; }
.logo.dark { color: var(--navy); margin: 0 0 6px; }
.logo-sub { font: 500 7pt/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #7cc6e6; }
.cover-grid { display: grid; grid-template-columns: minmax(0, 1fr) 3.3in; gap: .35in; align-items: start; }
.cover h1 { color: #fff; font-size: 38pt; line-height: 1.02; font-weight: 800; margin-bottom: .3em; }
.cover h1 span { display: block; color: #6cc0e5; }
.cover-device { width: 100%; filter: drop-shadow(0 20px 30px rgba(0,0,0,.45)); margin-top: .1in; }
.toc { margin-top: .45in; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.12); padding: 6px 0; margin: 0; }
.toc a { color: #fff; }
.toc em { font-style: normal; font-size: 7pt; background: var(--pin); border-radius: 99px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.toc span { color: #7cc6e6; font-family: var(--mono); font-size: 8.5pt; }
.cover-rev { position: absolute; bottom: .5in; left: .7in; font: 500 7.5pt var(--mono); letter-spacing: .12em; color: #7cc6e6; }

/* ---------- layout ---------- */
.split { display: grid; grid-template-columns: 1fr 3.05in; gap: .35in; align-items: start; }
.split.wide-fig { grid-template-columns: 3.55in 1fr; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .35in; align-items: start; }
.pair .device { margin-top: .1in; }
.pair.small { max-width: 3.4in; margin: 0 auto; gap: .25in; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: .2in; margin: .15in 0 .1in; }
.cards3, .cards2 { display: grid; gap: .16in; margin: .2in 0; }
.cards3 { grid-template-columns: repeat(3, 1fr); }
.cards2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }
.card p { margin: 0; font-size: 9pt; }
.card h3 { margin-bottom: .25em; }

/* ---------- figures ---------- */
figure { margin: 0; }
figcaption { font-size: 8.5pt; color: var(--muted); margin-top: 6px; text-align: center; line-height: 1.4; }
.shot { position: relative; }
.device .shot img { filter: drop-shadow(0 6px 12px rgba(15,34,48,.18)); }
/* Pins use screenshot percentages (--x, --y); the math maps them into the bezel. */
.pin {
  position: absolute; transform: translate(-50%, -50%);
  left: calc(5.053% + var(--x) * .8989%); top: calc(4.167% + var(--y) * .9167%);
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--pin); color: #fff; font-size: 9pt; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.pin-inline {
  display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  background: var(--pin); color: #fff; font-size: 7.5pt; font-weight: 700; vertical-align: 1px;
}
.browser { position: relative; margin: .1in auto .15in; max-width: 5.1in; }
.browser img { border-radius: 10px; box-shadow: 0 6px 18px rgba(15,34,48,.22); }
.browser .pin { width: 24px; height: 24px; }
.ic {
  display: inline-block; width: 20px; height: 20px; border-radius: 50%;
  vertical-align: -5px; margin: 0 1px;
}
.i {
  display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%;
  border: 1.2px solid var(--accent); color: var(--accent); font: 600 7.5pt/1 Georgia, serif; font-style: italic;
}

/* ---------- lists ---------- */
.steps { list-style: none; padding: 0; counter-reset: st; }
.steps > li { counter-increment: st; position: relative; padding-left: 32px; margin-bottom: .75em; }
.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: -1px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff;
  font-size: 9pt; font-weight: 700; display: grid; place-items: center;
}
.steps.compact > li { margin-bottom: .45em; }
.key { list-style: none; padding: 0; counter-reset: k; }
.key > li { counter-increment: k; position: relative; padding-left: 28px; margin-bottom: .6em; font-size: 9.5pt; }
.key > li::before {
  content: counter(k); position: absolute; left: 0; top: 0;
  width: 19px; height: 19px; border-radius: 50%; background: var(--pin); color: #fff;
  font-size: 8.5pt; font-weight: 700; display: grid; place-items: center;
}
ul.check { list-style: none; padding: 0; }
ul.check li { padding-left: 20px; position: relative; }
ul.check li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }

/* ---------- callouts ---------- */
.note { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 6px; padding: 12px 16px; margin: .2in 0; }
.note strong { display: block; color: var(--navy); margin-bottom: 4px; }
.note ul, .note p:last-child { margin-bottom: 0; }
.new-box { background: #fff4ec; border-left-color: var(--pin); }
.tip { font-size: 9pt; color: var(--muted); }
.tip b { color: var(--ink); }

/* ---------- tables ---------- */
:where(.guide) table { border-collapse: collapse; width: 100%; }
.icons { font-size: 9pt; margin-top: .08in; }
.icons th { text-align: left; font: 500 7pt var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 8px 6px 0; border-bottom: 1px solid var(--line); }
.icons td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.icons td:first-child { width: 34px; }
.icons td:first-child img { width: 26px; height: 26px; border-radius: 50%; }
.icons td:nth-child(2) { font-weight: 600; white-space: nowrap; }
.icons td:nth-child(3) { color: var(--muted); white-space: nowrap; }
.icons tr.new td:nth-child(2)::after { content: "NEW"; font-size: 6.5pt; background: var(--pin); color: #fff; border-radius: 99px; padding: 1px 5px; margin-left: 5px; vertical-align: 1px; }
.legend { margin: .15in 0 .25in; font-size: 9.5pt; }
.legend td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.legend td:first-child { width: 44px; }
.legend td:nth-child(2) { font-weight: 600; white-space: nowrap; width: 1.6in; }
.legend tr.warn { background: #fff8e9; }
.legend tr.bad { background: #fdeeec; }
.sw.dot { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin: auto; }
.sw.line { display: block; width: 30px; height: 4px; border-radius: 2px; background: var(--c); margin: auto; }
.simple td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); font-size: 9.5pt; vertical-align: top; }
.simple td:first-child { white-space: nowrap; width: 1in; }
.bluedot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3d8fd9; }
.red { color: var(--red); }

/* ---------- FAQ + contact ---------- */
.faq { margin: .2in 0 .35in; }
.faq dt { font-weight: 600; color: var(--navy); margin-top: .7em; font-size: 10.5pt; }
.faq dd { margin: .15em 0 0; color: var(--ink); }
.contact { border-top: 2px solid var(--navy); padding-top: .2in; font-size: 9.5pt; }
.legal { position: absolute; left: .7in; right: .7in; bottom: .75in; font-size: 7pt; color: var(--muted); }

/* ---------- screen / web version ---------- */
@media screen {
  body { background: #eef3f6; }
  /* Site header sits on the grey page: keep it solid so it reads in dark mode too */
  #siteheader { background: var(--surface); border-bottom-color: var(--hairline); }
  /* Contents links land below the sticky header, not under it */
  .guide [id] { scroll-margin-top: 88px; }
  .page {
    width: auto; height: auto; max-width: 8.5in; margin: 24px auto; overflow: visible;
    background: #fff; border-radius: 14px; box-shadow: 0 2px 14px rgba(15,34,48,.08);
  }
  .cover { background: radial-gradient(120% 90% at 85% 30%, #1b4560 0%, var(--navy) 60%); }
  .folio, .cover-rev { display: none; }
  .legal { position: static; margin-top: .3in; }
}
@media screen and (max-width: 760px) {
  .guide { font-size: 15px; }
  .page { margin: 0; border-radius: 0; padding: 32px 16px; }
  .cover-grid, .split, .split.wide-fig, .pair, .trio, .cards3, .cards2 { grid-template-columns: 1fr; }
  .device { max-width: 420px; margin-left: auto; margin-right: auto; }
  .cover h1 { font-size: 34pt; }
  .icons td:nth-child(3) { white-space: normal; }
}
@media print {
  /* The site header is for browsing; the printed guide stays as designed */
  #siteheader { display: none; }
}
