/* ============================================================
   docs.css — FAQ and Runbook sections.
   Uses the tokens from variables.css so it tracks the rest of
   the portal's theme rather than hard-coding a second palette.
   ============================================================ */

.doc-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 4px 0 48px;
}

.doc-header {
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.16);
}

.doc-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.45);
  margin: 0 0 6px;
}

.doc-lede {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.doc-body { display: flex; flex-direction: column; gap: 26px; }

.doc-group {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--doc-accent, var(--cyan));
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 16px 18px 6px;
}

.doc-group-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--doc-accent, var(--cyan));
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.doc-group-icon {
  font-size: 15px;
  opacity: 0.9;
  text-shadow: 0 0 10px var(--doc-accent, var(--cyan));
}

.doc-item {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2px 0;
}
.doc-item:first-of-type { border-top: none; }

.doc-q {
  font-family: var(--font-ui);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  padding: 11px 26px 11px 0;
  position: relative;
  transition: color 0.15s ease;
}
.doc-q::-webkit-details-marker { display: none; }
.doc-q:hover { color: var(--doc-accent, var(--cyan)); }

.doc-q::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--doc-accent, var(--cyan));
  opacity: 0.75;
  transition: transform 0.18s ease;
}
.doc-item[open] > .doc-q::after { content: '\2212'; }

.doc-a {
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--text-dim);
  padding: 0 8px 16px 0;
}
.doc-a b { color: var(--text); font-weight: 600; }
.doc-a i { color: var(--text-dim); font-style: italic; }
.doc-a code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 3px;
  padding: 1px 5px;
}
.doc-a ul { margin: 8px 0 0; padding-left: 20px; }
.doc-a li { margin-bottom: 5px; }

.doc-empty {
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
}

@media (max-width: 760px) {
  .doc-wrap  { padding: 0 2px 36px; }
  .doc-title { font-size: 21px; }
  .doc-group { padding: 13px 14px 4px; }
  .doc-q     { font-size: 14.5px; }
  .doc-a     { font-size: 13.8px; }
}

/* ---- Build Guide (added 2026-08-12) ---- */
.bg-hero {
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap);
  flex-wrap: wrap;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.07), rgba(176, 64, 255, 0.05));
  padding: 18px 20px; margin: 0 0 18px;
}
.bg-kicker {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .34em;
  color: var(--cyan); margin-bottom: 6px;
}
.bg-title {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  color: var(--text); margin: 0 0 4px; letter-spacing: .5px;
}
.bg-sub { font-family: var(--font-ui); font-size: 14px; color: var(--text-dim); margin: 0 0 6px; }
.bg-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin: 0; }
.bg-dl {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: #05030f; background: var(--cyan); padding: 11px 18px;
  border-radius: var(--radius); font-weight: 700; transition: filter .15s ease;
}
.bg-dl:hover { filter: brightness(1.15); }

/* Two volumes, so the single nowrap pill becomes a stacked pair. Each control
   names its book and carries its own page count from the manifest. */
.bg-dls { display: flex; flex-direction: column; gap: 8px; flex: none; }
.bg-dls .bg-dl {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 9px 16px; letter-spacing: .08em; min-width: 210px;
}
.bg-dl-n { font-size: 12px; font-weight: 700; }
.bg-dl-s {
  font-size: 10px; font-weight: 500; letter-spacing: .04em;
  text-transform: none; opacity: .78;
}
@media (max-width: 720px) {
  .bg-dls { width: 100%; }
  .bg-dls .bg-dl { min-width: 0; align-items: center; text-align: center; }
}

/* Shown in place of the chapter list when the server declines the manifest
   (added 2026-08-14 with the access gate). Same frame as .bg-hero, stacked
   rather than split, since there is no download button to sit opposite. */
.bg-locked {
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.07), rgba(176, 64, 255, 0.05));
  padding: 22px 20px; margin: 0;
}
.bg-locked .doc-empty { margin: 12px 0 14px; }
.bg-locked .auth-signin-btn { display: inline-block; }

.bg-tracks { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.bg-track {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: 1px solid rgba(106, 138, 170, 0.35); border-radius: var(--radius);
  padding: 8px 14px; transition: all .15s ease;
}
.bg-track:hover { color: var(--text); border-color: var(--cyan); }
.bg-track.active { color: #05030f; background: var(--text); border-color: var(--text); font-weight: 700; }

.bg-num {
  font-family: var(--font-mono); font-size: 11px; color: var(--cyan);
  margin-right: 10px; opacity: .85;
}
.bg-tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--magenta);
  border: 1px solid rgba(255, 69, 200, 0.45); border-radius: 3px;
  padding: 2px 6px; margin-left: 10px; vertical-align: middle;
}

/* rendered chapter bodies: keep long commands inside the panel */
.bg-body { max-height: 60vh; overflow-y: auto; }
.bg-body pre {
  background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(106, 138, 170, 0.22);
  border-left: 2px solid var(--blue); border-radius: 4px;
  padding: 10px 12px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: #cfe6f5;
  white-space: pre-wrap; word-break: break-word;
}
.bg-body code { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); }
.bg-body pre code { color: inherit; font-size: inherit; }
.bg-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.bg-body th, .bg-body td {
  border: 1px solid rgba(106, 138, 170, 0.22); padding: 6px 8px;
  text-align: left; vertical-align: top;
}
.bg-body th { background: rgba(0, 229, 255, 0.07); color: var(--text); }
.bg-body h2 { font-family: var(--font-display); font-size: 16px; color: var(--text); margin: 18px 0 6px; }
.bg-body h3 { font-family: var(--font-ui); font-size: 14px; color: var(--text); margin: 14px 0 5px; }
.bg-body blockquote {
  border-left: 2px solid var(--purple); margin: 10px 0; padding: 2px 0 2px 12px;
  color: var(--text-dim); font-style: italic;
}

@media (max-width: 720px) {
  .bg-hero { flex-direction: column; align-items: flex-start; }
  .bg-dl { width: 100%; text-align: center; }
}
