/* The portal's only stylesheet. Served under script-src/style-src 'self', so nothing here
   is inline and nothing is fetched from another origin. */

:root {
  --bg: #0f1115;
  --panel: #161a21;
  --line: #262c36;
  --text: #e6e9ef;
  --muted: #98a2b3;
  --accent: #6ea8fe;
  --accent-ink: #0b1220;
  --warn: #f0b429;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --line: #e4e7ec;
    --text: #14181f;
    --muted: #667085;
    --accent: #1f6feb;
    --accent-ink: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.55 ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 620;
  letter-spacing: 0.01em;
}

.mark {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  /*
   * The accent colour is painted underneath the artwork, not replaced by it. If
   * `/brand/icon.png` is absent the mark renders as the plain accent square the portal
   * used before, rather than as a broken image — a missing brand asset should look
   * unbranded, not broken.
   */
  background-color: var(--accent);
  background-image: url('/brand/icon.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
  flex: none;
}

.env {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 22px 60px;
}

h1 {
  font-size: 24px;
  margin: 0 0 6px;
}

h2 {
  font-size: 16px;
  margin: 26px 0 10px;
}

.lede {
  color: var(--muted);
  margin: 0 0 20px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
}

button:hover {
  border-color: var(--accent);
}

button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
  padding: 10px 20px;
}

.link {
  border: 0;
  padding: 0 0 14px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-start;
  text-align: left;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.card-name {
  font-weight: 620;
}

.card-desc {
  color: var(--muted);
  font-size: 13px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.meta-value {
  font-size: 14px;
}

.sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.section-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.section-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}

.section-title {
  font-weight: 600;
  font-size: 14px;
}

.facts {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  font-size: 12px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  overflow-x: auto;
  color: var(--warn);
  font-size: 13px;
  white-space: pre-wrap;
}

.foot {
  border-top: 1px solid var(--line);
  padding: 14px 22px;
  color: var(--muted);
  font-size: 12px;
}

/* Validation state. Deliberately louder than the other tags: it is the one that says
   whether anything here has been proven, and it should not read as decoration. */
.status-not_tested {
  color: var(--warn);
  border-color: var(--warn);
}

.status-pass {
  color: #3fb950;
  border-color: #3fb950;
}

.status-partial {
  color: var(--warn);
  border-color: var(--warn);
}

.status-fail {
  color: #f85149;
  border-color: #f85149;
}
