/* Readiness Reports: a light "printed report" look (paper, ink, ruled table),
   with a dark "Under the hood" panel beside the page content. Served as a
   file because the CSP allows no inline styles. */

:root {
  --paper: #f7f5ef;
  --card: #fffdf7;
  --ink: #1d2430;
  --muted: #6b6450;
  --rule: #d8d2c2;
  --rule-light: #e2dccb;
  --field: #bdb59f;
  --tag: #e9e3d2;
  --gold: #c9a227;
  --ok: #1f6f43;
  --fail: #8a2f2f;
  --panel-text: #e8e4d8;
  --panel-code-bg: #121822;
  --panel-json: #cfe3ff;
  --panel-code: #9fd3a8;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
code { font-family: var(--mono); font-size: 0.9em; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.25; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header bar */

.bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding: 12px 16px;
  background: var(--ink); color: var(--paper);
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.who-name { font-weight: 600; }
.who-email { opacity: 0.8; }
.badge {
  padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700;
  color: #ffffff; border: 1px solid transparent;
}
.badge-navy { background: #00205B; border-color: #3a5a9a; }
.badge-airforce { background: #5D8AA8; color: #0b1622; }
.badge-army { background: #4B5320; }
.badge-default { background: #1d2430; border-color: #8a8f99; }
.signout { margin: 0; }
.signout button {
  font: inherit; font-size: 13px; cursor: pointer;
  background: transparent; color: var(--paper);
  border: 1px solid #6b7280; border-radius: 4px; padding: 3px 10px;
}
.signout button:hover, .signout button:focus-visible { border-color: var(--paper); }

/* Page layout: content, then the panel; side by side on wide screens */

.layout {
  display: grid; gap: 20px; align-items: start;
  max-width: 1240px; margin: 0 auto; padding: 20px 16px;
}
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
}
.content, .side { min-width: 0; }
.entity { max-width: 1240px; margin: 0 auto; padding: 0 16px 24px; font-size: 13px; color: var(--muted); }

/* Status */

.status {
  margin-bottom: 16px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--gold);
}
.status-member { border-left-color: var(--ok); }
.status-declined { border-left-color: var(--fail); }
.status-msg { margin: 0; font-weight: 600; }
.alert { margin: 6px 0 0; color: var(--fail); font-weight: 600; }

/* Boxes: join a federation, sign in */

.box { background: var(--card); border: 1px solid var(--rule); padding: 14px; }
.box-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.box-title {
  margin: 0; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
.admin { font-size: 11px; background: var(--tag); padding: 1px 8px; border-radius: 8px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type="text"], select {
  display: block; width: 100%; padding: 7px 9px;
  font: 14px var(--mono); color: var(--ink);
  background: #ffffff; border: 1px solid var(--field); border-radius: 2px;
}
select { font-family: inherit; }
input[aria-invalid="true"] { border-color: var(--fail); }
.field-error { margin: 6px 0 0; color: var(--fail); font-size: 14px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 4px; padding: 6px 14px;
}
.btn:hover { background: #2c3546; }
.btn:disabled { background: var(--field); color: #f3f0e6; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .chip:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.sub { margin: 0 0 10px; }
.empty { margin: 0 0 4px; font-weight: 600; }

.fed-result { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-light); }
.fed-name { margin: 0; font-weight: 700; }
.fed-meta { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; }
.check { display: flex; gap: 8px; margin: 6px 0; font-size: 14px; }
.check-mark { font-weight: 700; flex: none; width: 1em; }
.check-ok .check-mark { color: var(--ok); }
.check-fail .check-mark { color: var(--fail); }
.check-text { display: flex; flex-direction: column; min-width: 0; }
.check-detail { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.fed-blocked { margin: 8px 0 0; font-size: 14px; color: var(--fail); }

/* Organization picker (picker.js) */

.combo ul {
  list-style: none; margin: 4px 0 0; padding: 0; max-height: 240px; overflow-y: auto;
  background: #ffffff; border: 1px solid var(--field);
}
.combo li { display: flex; flex-direction: column; padding: 6px 9px; cursor: pointer; }
.combo li + li { border-top: 1px solid var(--rule-light); }
.combo li.active, .combo li:hover { background: var(--tag); }
.combo li[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--ink); }
.option-name { font-weight: 600; }
.option-detail { font-size: 12px; color: var(--muted); }
.combo .empty { margin-top: 6px; font-weight: 400; color: var(--muted); }

/* Readiness report */

.report-title { margin: 0; font-size: 22px; }
.stamp { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  padding: 3px 12px; border: 1px solid var(--field); border-radius: 14px;
  color: var(--ink); text-decoration: none; font-size: 13px; background: var(--card);
}
.chip:hover { border-color: var(--ink); }
.chip-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.table-wrap { overflow-x: auto; }
.report { width: 100%; border-collapse: collapse; font-size: 14px; }
.report th, .report td { padding: 7px 8px; text-align: left; vertical-align: top; }
.report th {
  border-bottom: 2px solid var(--ink);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
}
.report td { border-bottom: 1px solid var(--rule-light); }
.report .num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.pill-c1 { background: #1f6f43; color: #d9ffe8; }
.pill-c2 { background: #2f5d8a; color: #e2f0ff; }
.pill-c3 { background: #8a6a1f; color: #fff3d6; }
.pill-c4 { background: #8a2f2f; color: #ffe1e1; }
.legend { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 2; }
.legend .pill { margin-left: 6px; }
.legend .pill:first-child { margin-left: 0; }
.note { font-size: 13px; color: var(--muted); }

/* Under the hood */

.hood { background: var(--ink); color: var(--panel-text); border-radius: 6px; padding: 12px 14px; font-size: 14px; }
.hood summary {
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.hood code { color: var(--panel-code); }
.hood p { margin: 4px 0 8px; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; }
.step { padding: 8px 0 4px 10px; border-left: 3px solid transparent; }
.step + .step { border-top: 1px solid #2c3546; }
.step-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.step-mark {
  display: inline-block; min-width: 1.5em; margin-right: 6px;
  font-weight: 700; text-align: center;
}
.step-todo { opacity: 0.7; }
.step-done .step-mark { color: var(--panel-code); }
.step-current { border-left-color: var(--gold); }
.step-current .step-title, .step-current .step-mark { color: var(--gold); }
.json-label { margin: 8px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.8; }
.json {
  margin: 0 0 8px; padding: 8px; border-radius: 4px; max-height: 320px; overflow: auto;
  background: var(--panel-code-bg); color: var(--panel-json);
  font: 12px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 0 0 8px; font-size: 13px; }
.facts dt { opacity: 0.8; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.hood .note { color: var(--panel-text); opacity: 0.8; }
