/* QRH flow — SpaceX chrome, phone-first, orange = vitals only */
html, body {
  background: #000 !important;
  color: #f0f0fa !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100dvh !important;
}
body { display: flex; flex-direction: column; }
.page-header h1, h1 {
  font-family: "D-DIN", "Arial Narrow", Arial, sans-serif;
  font-size: 24px !important;
  line-height: 1.25 !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: #f0f0fa !important;
}
.page-header h1 .fr, h1 .fr {
  display: block;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 16px !important;
  font-weight: 500;
  color: #bbb;
  margin-top: 6px;
  line-height: 1.3;
}
.badge {
  background: #E10600 !important;
  color: #f0f0fa !important;
  font-size: 12px !important;
  letter-spacing: 0.12em;
}

/* Condition / Objectif: black cards, white type — no purple/cyan */
.box-cond, .box-obj, .box {
  background: #000 !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 14px !important;
  padding: 18px 18px !important;
  margin: 12px 0 !important;
  box-shadow: none !important;
}
.box-cond .lbl, .box-obj .lbl, .box .lbl {
  font-family: "D-DIN", "Arial Narrow", Arial, sans-serif;
  color: #E10600 !important;
  font-size: 12px !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 10px !important;
}
.box-cond .txt, .box-obj .txt, .box .txt {
  color: #f0f0fa !important;
  font-size: 20px !important;
  line-height: 1.45 !important;
}

/* Vitals: orange ONLY */
.vital, .step.mem {
  background: #140c00 !important;
  border: 2px solid #ff9100 !important;
  color: #f0f0fa !important;
  border-radius: 14px !important;
  padding: 18px !important;
  box-shadow: none !important;
}
.vital .lbl, .vital strong {
  color: #ff9100 !important;
  font-size: 13px !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.vital .step, .vital p, .vital {
  font-size: 17px !important;
  line-height: 1.45 !important;
  color: #f0f0fa !important;
}
.vital .step {
  background: #1a1000 !important;
  border: 1px solid #ff9100 !important;
  color: #f0f0fa !important;
  font-size: 17px !important;
  padding: 14px !important;
}

/* Kill rainbow fill on plain .green info boxes — NOT end-ok */
.green:not(.choice-btn):not(.end-ok) {
  background: #000 !important;
  border: 1px solid #2a2a2a !important;
  color: #f0f0fa !important;
}
.green:not(.end-ok) strong { color: #f0f0fa !important; }

/* ===== CHECKLIST COMPLETE — Steve lock (dashed red + glow) =====
   Use on every QRH end: .end-ok / .end-warn / .end-crit / .end-except
   Markup ONLY:
   <div class="end-ok">
     <strong>Checklist Complete</strong>
     <span class="fr-done">Checklist terminée</span>
   </div>
   Optional do-not-repeat line inside the same .end-ok.
   Dots ● ● ● via ::after (use .no-dots to suppress). Do NOT add .end-squares.
*/
/* Extra bottom room so last NNC / Checklist Complete clears nav + AMDT + baBack */
.content-area {
  padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px)) !important;
}

.end-ok, .end-warn, .end-crit, .end-except {
  background: #0a0002 !important;
  border: 1.5px dashed #E10600 !important;
  border-radius: 14px !important;
  box-shadow:
    0 0 22px rgba(225, 6, 0, 0.55),
    0 0 48px rgba(225, 6, 0, 0.22),
    inset 0 0 22px rgba(225, 6, 0, 0.14) !important;
  color: #fff !important;
  position: relative;
  padding: 22px 16px !important;
  margin: 18px 0 12px !important;
  text-align: center;
}
.end-ok strong, .end-warn strong, .end-crit strong, .end-except strong {
  display: block;
  color: #E10600 !important;
  text-shadow: 0 0 10px #E10600, 0 0 24px #ff2d55, 0 0 40px rgba(225,6,0,.55);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 18px !important;
  font-weight: 800;
  line-height: 1.25;
}
.end-ok .fr-done, .end-warn .fr-done, .end-crit .fr-done, .end-except .fr-done {
  display: block;
  color: #ff8aa0;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 600;
  margin-top: 6px;
  text-shadow: 0 0 8px rgba(225, 6, 0, 0.5);
}
.end-ok::after, .end-warn::after, .end-crit::after, .end-except::after {
  content: "●  ●  ●";
  display: block;
  letter-spacing: 0.55em;
  color: #E10600;
  text-shadow: 0 0 8px #E10600, 0 0 18px #E10600, 0 0 32px #ff2d55;
  margin-top: 14px;
  font-size: 20px;
  filter: drop-shadow(0 0 6px #E10600);
}
.end-ok.no-dots::after, .end-warn.no-dots::after, .end-crit.no-dots::after, .end-except.no-dots::after {
  content: none !important;
}
/* DO NOT REPEAT line when present inside end box */
.end-ok .do-not-repeat, .end-warn .do-not-repeat, .end-crit .do-not-repeat {
  display: block;
  margin-top: 10px;
  color: #E10600 !important;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 10px #E10600, 0 0 22px #ff2d55;
}

/* Linear steps */
.step, .step-card, .cl .t, .chk-list li {
  font-size: 17px !important;
  line-height: 1.45 !important;
  color: #f0f0fa !important;
}
.step, .step-card {
  background: #0a0a0a !important;
  border: 1px solid #222 !important;
}
.step.mem { border-color: #ff9100 !important; background: #140c00 !important; }
/* QRH index rows: chapter-toc CARDS (not skinny underline lists) */
a.cl {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  background: linear-gradient(180deg, #161616 0%, #0e0e0e 100%) !important;
  border: 1px solid #2a2a2a !important;
  border-left: 4px solid var(--sec0, var(--sec1, var(--sec2, var(--sec3, var(--sec4, var(--sec5, var(--elec, var(--sec7, var(--sec8, var(--sec9, var(--sec10, var(--sec11, var(--sec12, var(--sec13, var(--sec14, var(--sec15, var(--sec16, var(--sec17, var(--sec18, var(--sec19, var(--sec20, #E10600)))))))))))))))))))) !important;
  border-radius: 14px !important;
  padding: 14px 14px !important;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  min-height: 52px !important;
  margin: 0 0 8px !important;
  box-sizing: border-box !important;
}
a.cl .t {
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: #fff !important;
}
a.cl .p {
  color: #8e8e93 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* Memory items — QRH Quick Action Index QA.1 (same as .ba-row.crit) */
a.cl.crit {
  border: 1px solid #6b1515 !important;
  background: #1a1010 !important;
  border-left: 4px solid #8b1a1a !important;
}
a.cl.crit .p {
  color: #ff8888 !important;
}
a.cl.form {
  border-left-color: #ffb020 !important;
  background: linear-gradient(180deg, #1a160c 0%, #100e08 100%) !important;
}

/* Decision buttons: 7.4 gros boutons — green / blue / red. Orange stays on vitals only. */
.choice-title {
  font-family: "D-DIN", "Arial Narrow", Arial, sans-serif;
  font-size: 15px !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f0f0fa !important;
}

.choice-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  align-items: stretch !important;
  margin: 12px 0 !important;
}

.choice-btn, a.choice-btn,
.choice-btn.yellow {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  background: #000 !important;
  border: 1.5px solid #E10600 !important;
  color: #f0f0fa !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  border-radius: 14px !important;
  font-family: "D-DIN", "Arial Narrow", Arial, sans-serif;
  letter-spacing: 0.02em;
  font-weight: 700 !important;
  text-align: center !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  min-height: 96px !important;
  padding: 16px 12px !important;
  width: 100% !important;
}

.choice-row .choice-btn, .choice-row a.choice-btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  min-height: 96px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 16px 12px !important;
}

.choice-btn .sub { color: inherit !important; font-size: 13px !important; opacity: 1; }
.choice-btn.green .sub, .choice-btn.blue .sub, .choice-btn.red .sub { opacity: 1 !important; }

/* 2 buttons: equal side-by-side, never wrap 2+1 leftover (incl. .stack) */
.choice-row:has(.choice-btn:nth-child(2)):not(:has(.choice-btn:nth-child(3))),
.choice-row.stack:has(.choice-btn:nth-child(2)):not(:has(.choice-btn:nth-child(3))) {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}
.choice-row:has(.choice-btn:nth-child(2)):not(:has(.choice-btn:nth-child(3))) .choice-btn {
  flex: 1 1 0 !important;
  width: auto !important;
  min-height: 96px !important;
}

/* 3+ buttons: column, full width, same min-height, no wrap leftover */
.choice-row:has(.choice-btn:nth-child(3)),
.choice-row.stack:has(.choice-btn:nth-child(3)) {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
}
.choice-row:has(.choice-btn:nth-child(3)) .choice-btn {
  width: 100% !important;
  flex: 0 0 auto !important;
  min-height: 96px !important;
}

/* Unstyled 2-button rows: 1st green, last red. Explicit .green/.red/.blue still win. */
.choice-row:has(.choice-btn:nth-child(2)):not(:has(.choice-btn:nth-child(3))) > .choice-btn:first-child:not(.green):not(.red):not(.blue) {
  background: #1b5e20 !important;
  border: 2px solid #00e676 !important;
  color: #fff !important;
}
.choice-row:has(.choice-btn:nth-child(2)):not(:has(.choice-btn:nth-child(3))) > .choice-btn:last-child:not(.green):not(.red):not(.blue) {
  background: #4a0018 !important;
  color: #fff !important;
  border: 2px solid #ff4d8d !important;
  box-shadow: 0 0 14px rgba(255, 77, 141, 0.35) !important;
}

/* Unstyled 3-button rows: green / blue / red */
.choice-row:has(.choice-btn:nth-child(3)):not(:has(.choice-btn:nth-child(4))) > .choice-btn:nth-child(1):not(.green):not(.red):not(.blue) {
  background: #1b5e20 !important;
  border: 2px solid #00e676 !important;
  color: #fff !important;
}
.choice-row:has(.choice-btn:nth-child(3)):not(:has(.choice-btn:nth-child(4))) > .choice-btn:nth-child(2):not(.green):not(.red):not(.blue) {
  background: #0d47a1 !important;
  border: 2px solid #40c4ff !important;
  color: #fff !important;
}
.choice-row:has(.choice-btn:nth-child(3)):not(:has(.choice-btn:nth-child(4))) > .choice-btn:nth-child(3):not(.green):not(.red):not(.blue) {
  background: #4a0018 !important;
  color: #fff !important;
  border: 2px solid #ff4d8d !important;
  box-shadow: 0 0 14px rgba(255, 77, 141, 0.35) !important;
}


/* Phone: 2 long decision labels must stack — never squash into inline soup */
@media (max-width: 640px) {
  .choice-row:has(.choice-btn:nth-child(2)):not(:has(.choice-btn:nth-child(3))),
  .choice-row.stack:has(.choice-btn:nth-child(2)):not(:has(.choice-btn:nth-child(3))) {
    flex-direction: column !important;
  }
  .choice-row:has(.choice-btn:nth-child(2)):not(:has(.choice-btn:nth-child(3))) .choice-btn {
    width: 100% !important;
    flex: 0 0 auto !important;
  }
}

/* Explicit color classes — always win; STOP flattening .blue to black */
.choice-btn.green, a.choice-btn.green {
  background: #1b5e20 !important;
  border: 2px solid #00e676 !important;
  color: #fff !important;
}
.choice-btn.blue, a.choice-btn.blue {
  background: #0d47a1 !important;
  border: 2px solid #40c4ff !important;
  color: #fff !important;
}
.choice-btn.red, a.choice-btn.red {
  background: #4a0018 !important;
  color: #fff !important;
  border: 2px solid #ff4d8d !important;
  box-shadow: 0 0 14px rgba(255, 77, 141, 0.35) !important;
}

/* Type-specific QRH PI tables/graphs. Official page image or transcribed numbers only. */
.pi-block{background:#0a0a0a;border:1px solid #2a2a2a;border-radius:14px;padding:12px 12px 10px;margin:14px 0;}
.pi-block .cap{color:#E10600;font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;margin:0 0 8px;}
.pi-block .fr{font-size:13px;color:#bbb;margin:0 0 10px;line-height:1.4;}
.pi-block img{width:100%;height:auto;border-radius:8px;background:#fff;display:block;}
.pi-block .pdf-link{margin:10px 0 0;}
.pi-tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:8px 0;}
.pi-tbl{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums;}
.pi-tbl th,.pi-tbl td{border:1px solid #333;padding:6px 8px;text-align:right;color:#eee;}
.pi-tbl th{background:#111;color:#E10600;text-align:center;font-size:11px;letter-spacing:.06em;}
.pi-tbl td:first-child,.pi-tbl th:first-child{text-align:left;}

/* Deferred Items — ice-blue futurist (not red). All NNC. */
.def-bar {
  background: linear-gradient(90deg, #7ee8ff 0%, #d4f7ff 50%, #7ee8ff 100%) !important;
  color: #021018 !important;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 14px !important;
  padding: 14px 14px;
  border-radius: 12px;
  margin: 18px 0 12px;
  box-shadow: 0 0 22px rgba(126, 232, 255, 0.55);
  border: 1px solid #b8f4ff;
}
.end-except {
  background: #000 !important;
  border: 1px dashed #7ec8ff !important;
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
  text-align: center;
  color: #f0f0fa !important;
}
.end-except::after { content: none !important; }
.step-card.deferred, .deferred {
  border: 1px solid #5ad0f0 !important;
  border-left: 4px solid #7ee8ff !important;
  background: linear-gradient(180deg, #062028 0%, #04141c 100%) !important;
  box-shadow: 0 0 14px rgba(90, 208, 240, 0.22);
}
.def-chk {
  color: #7ee8ff !important;
  text-shadow: 0 0 10px rgba(126, 232, 255, 0.55);
  font-size: 15px !important;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 16px 0 8px;
}
.end-squares {
  text-align: center;
  color: #ff1744;
  text-shadow: 0 0 10px #ff1744, 0 0 22px #ff2d55;
  letter-spacing: 0.55em;
  font-size: 22px;
  margin: 16px 0 8px;
}
.choice-title .fr {
  display: block;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 14px !important;
  font-weight: 500;
  color: #bbb;
  margin-top: 6px;
}


.kv{display:flex;justify-content:space-between;gap:12px;align-items:baseline;padding:6px 0;border-bottom:1px solid #1c1c1c;font-size:16px;}
.kv .r{color:#fff;font-weight:800;text-align:right;}

hr.sep, .sep{border:none;border-top:2px dashed #333;margin:20px 0;}
.pdf-link{display:block;text-align:center;background:#1a1a1a;border:1px solid #E10600;color:#E10600;padding:12px;border-radius:12px;font-weight:700;text-decoration:none;margin:14px 0;}
.gloss{opacity:.8;font-size:13px;display:block;margin-top:4px;}
.step-card .gloss, .step-card span.gloss { display:block !important; margin-top:6px !important; font-size:13px !important; color:#bbb !important; font-weight:500 !important; }
.back-steps{display:block;text-align:center;color:#888;font-size:13px;margin:10px 0;text-decoration:none;}

.vital .gloss, .step .gloss { display:block; margin-top:4px; font-size:13px; color:#bbb; font-weight:500; letter-spacing:0; text-transform:none; }
.vital .step strong { color:#ff9100 !important; }
