/* Secret Zone: the /security page. Loaded after site.css and portal.css and uses their tones, fonts and parts (.sec,
   .sec-head, .pairs, .log, .btn, .kicker). One colour theme, as on the rest of the portal; no text under 15px; every
   state is a glyph and a word, never colour alone. No inline styles: the page runs under style-src 'self'. */

.sec-page main.sec-main { max-width: 1180px; margin: 0 auto; padding-top: clamp(96px, 9vw, 140px); }

.sec-bar {
  position: absolute;
  z-index: 2;
  top: calc(20px + env(safe-area-inset-top, 0px));
  left: calc(var(--gut) + env(safe-area-inset-left, 0px));
  right: calc(var(--gut) + env(safe-area-inset-right, 0px));
  width: auto; /* site.css gives a bare header the full width on a phone, which pushed this bar past the right edge */
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sec-bar .brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }

.sec-intro { display: grid; gap: 14px; max-width: 46em; padding-bottom: clamp(26px, 2.6vw, 44px); }
.sec-intro h1 { font-size: clamp(40px, 4.4vw, 76px); line-height: 1.02; }
.sec-lede { color: var(--ink-2); font-size: 1.06em; }

/* ---------- the verdict ---------- */
.verdict {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px clamp(16px, 1.8vw, 30px);
  margin-bottom: clamp(26px, 2.6vw, 44px);
  padding: clamp(18px, 1.9vw, 32px);
  border: 1px solid var(--hair-2);
  border-top: 3px solid var(--hair-2);
  border-radius: 8px;
  background: var(--sheet);
}
.verdict[data-state="ok"] { border-top-color: var(--live); }
.verdict[data-state="partly"], .verdict[data-state="preview"] { border-top-color: var(--gold); }
.verdict[data-state="failed"] { border-top-color: var(--red); background: linear-gradient(var(--red-soft), var(--sheet) 70%); }
.verdict-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--hair-2);
  border-radius: 50%;
  font: 500 24px/1 var(--mono);
  color: var(--ink-2);
}
.verdict[data-state="ok"] .verdict-mark { color: var(--live); border-color: var(--live); }
.verdict[data-state="partly"] .verdict-mark, .verdict[data-state="preview"] .verdict-mark { color: var(--gold-t); border-color: var(--gold); }
.verdict[data-state="failed"] .verdict-mark { color: var(--red-t); border-color: var(--red); }
.verdict-text { display: grid; gap: 8px; min-width: 0; }
.verdict-text h2 { font-size: clamp(30px, 2.8vw, 46px); }
.verdict-text p { color: var(--ink-2); }
.verdict-why { margin: 4px 0 0; padding-left: 1.1em; color: var(--ink-2); }
.verdict-why li + li { margin-top: 4px; }
/* A failed check may name an address of a thousand characters: it wraps inside its sheet and never runs past it. */
.verdict-text p, .verdict-why li, .chk-note, .row-values dd, #evidence-facts dd { overflow-wrap: anywhere; }
.verdict[data-state="failed"] .verdict-why { color: var(--ink); }
.verdict-side { display: grid; justify-items: end; gap: 10px; }
.verdict-when { color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) {
  .verdict { grid-template-columns: auto minmax(0, 1fr); }
  .verdict-side { grid-column: 1 / -1; justify-items: start; }
  .verdict-when { white-space: normal; }
}

/* ---------- the rows ---------- */
.chks { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.chk { border-bottom: 1px solid var(--hair); }
.chk-empty { padding: 18px 0; color: var(--muted); border-bottom: 1px solid var(--hair); }
.chk-sum {
  display: grid;
  grid-template-columns: minmax(9em, 0.9fr) minmax(0, 2fr) auto;
  align-items: baseline;
  gap: 6px 24px;
  padding: 16px 4px;
  cursor: pointer;
  list-style: none;
}
.chk-sum::-webkit-details-marker { display: none; }
.chk-sum:hover { background: rgba(255, 255, 255, 0.02); }
.chk-label { font: 500 var(--lbl)/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.chk-value { color: var(--ink); font-size: 1.05em; }
.chk-mark { display: inline-flex; align-items: baseline; gap: 8px; font: 500 var(--lbl)/1.4 var(--mono); letter-spacing: 0.06em; color: var(--ink-2); white-space: nowrap; }
.chk-glyph { display: inline-block; width: 1.1em; text-align: center; }
.chk[data-state="checked"] .chk-mark { color: var(--live); }
.chk[data-state="stated"] .chk-mark { color: var(--gold-t); }
.chk[data-state="failed"] .chk-mark { color: var(--red-t); }
.chk[data-state="failed"] .chk-value { color: var(--red-t); }
.chk[data-state="aged"] .chk-mark, .chk[data-state="sample"] .chk-mark { color: var(--gold-t); }
.chk[data-state="not-checked"] .chk-mark, .chk[data-state="held"] .chk-mark { color: var(--muted); }
.chk-box[open] .chk-sum { border-bottom: 1px dashed var(--hair); }
.chk-body { display: grid; gap: 8px; max-width: 56em; padding: 14px 4px 22px; color: var(--ink-2); }
.chk-body h3 { margin-top: 8px; font: 500 var(--lbl)/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.chk-note { color: var(--ink); }
.row-values { margin-top: 6px; }
.row-values dd { margin: 0; color: var(--ink-2); }
@media (max-width: 720px) {
  .chk-sum { grid-template-columns: minmax(0, 1fr) auto; }
  .chk-value { grid-column: 1 / -1; grid-row: 2; }
  .row-values { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .row-values dd + dt { margin-top: 10px; }
}

/* ---------- later, evidence, the recipe ---------- */
.later { display: grid; gap: 10px; margin: 0; padding: 0 0 0 1.1em; color: var(--ink-2); }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.downloads a { text-decoration: none; }
#evidence-facts dd { margin: 0; color: var(--ink-2); }
.recipe { display: grid; gap: 16px; max-width: 62em; color: var(--ink-2); }
.steps { display: grid; gap: 22px; margin: 6px 0 0; padding-left: 1.3em; }
.steps li { display: grid; gap: 10px; padding-left: 6px; }
.steps li::marker { font: 500 var(--lbl) var(--mono); color: var(--gold-t); }
.steps h3 { color: var(--ink); }
.recipe .log { overflow-x: auto; white-space: pre; }
/* Grid items default to their content's width; the commands above scroll inside their box instead of widening the page. */
.recipe, .recipe > *, .steps, .steps li, .steps li > *, .verdict-text, .chk-sum > * { min-width: 0; max-width: 100%; }
.sec-intro h1 { overflow-wrap: break-word; }
.relies p { max-width: 56em; color: var(--muted); }

.preview-banner { margin-bottom: 18px; }

/* ---------- reading surfaces ----------
   The dot field and the film grain are the page's ground, as on the rest of the site. No text sits on them: each
   section is a sheet, as the verdict is, and the grain is lighter here than on the lander. */
body.sec-page { --f1: 0.14; --f2: 0.08; }
.sec-page .sec {
  margin-top: clamp(16px, 1.5vw, 24px);
  padding: clamp(22px, 2vw, 34px) clamp(18px, 2.3vw, 38px) clamp(20px, 1.9vw, 32px);
  border: 1px solid var(--hair-2);
  border-radius: 8px;
  background: var(--sheet);
}
.sec-page .sec-head { margin-bottom: clamp(12px, 1.1vw, 18px); }
.sec-page .chks { border-top-color: var(--hair-2); }
.sec-page .chks .chk:last-child, .sec-page .chks .chk-empty:last-child { border-bottom: 0; }
.sec-page .sec:has(> .chks) { padding-bottom: clamp(6px, 0.6vw, 12px); }
.sec-page .chk-sum { padding: 16px 10px; margin: 0 -10px; border-radius: 6px; }
.sec-page .chk-sum:hover { background: rgba(255, 255, 255, 0.035); }
.sec-page .chk-label { color: var(--ink-2); opacity: 0.82; }
.sec-page .relies p { color: var(--ink-2); }
/* The words above the first sheet sit on the ground itself: a soft shade under them keeps the dots off the letters. */
.sec-intro { position: relative; }
.sec-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -28px -40px -18px;
  background: radial-gradient(ellipse at 30% 50%, rgba(9, 9, 8, 0.92), rgba(9, 9, 8, 0.7) 60%, rgba(9, 9, 8, 0) 100%);
  pointer-events: none;
}
/* The steps are grids, which draw no list marker, and the page's own text names them by number ("step 5"). */
.sec-page .steps { counter-reset: step; padding-left: 0; list-style: none; }
.sec-page .steps li { counter-increment: step; padding-left: 0; }
.sec-page .steps h3::before { content: counter(step) "\00a0\00a0"; font: 500 var(--lbl)/1 var(--mono); color: var(--gold-t); }
@media (max-width: 720px) {
  .sec-page .sec { padding-left: 14px; padding-right: 14px; }
  .sec-page .chk-sum { padding: 14px 6px; margin: 0 -6px; }
}
