:root {
  --bg: #f3efe6;
  --surface: rgba(255, 255, 255, 0.55);
  --ink: #1c1915;
  --muted: #5c554c;
  --accent: #0f5c4c;
  --accent-ink: #fff;
  --border: #cfc4b2;
  --danger: #8a1f1f;
  --ok: #0f5c4c;
  --focus: #0b3d74;
  --page: radial-gradient(circle at top left, #fff8ea 0, transparent 45%),
          linear-gradient(160deg, #efe7d8, #f7f3eb 40%, #e7efe9);
  color-scheme: light dark;
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
}

/* Testers open this on a phone, often at night. The palette keeps the same
   contrast relationships rather than inverting into a washed-out grey. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: rgba(255, 255, 255, 0.04);
    --ink: #ece6db;
    --muted: #a49c8f;
    --accent: #5fd3b2;
    --accent-ink: #06231c;
    --border: #3a4048;
    --danger: #ff9b9b;
    --ok: #5fd3b2;
    --focus: #8ab8ff;
    --page: radial-gradient(circle at top left, #1d2128 0, transparent 45%),
            linear-gradient(160deg, #171a1f, #14161a 40%, #121a18);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  background-color: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  /* Hardcoded white here rendered near-white-on-white once dark mode landed,
     so the first thing a keyboard user tabbed to was invisible. */
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--focus);
  padding: 0.5rem 1rem;
}
.skip-link:focus { left: 0; z-index: 10; }
.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.brand {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
nav { display: flex; flex-wrap: wrap; gap: 0.85rem; }
nav a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.15; }
.button, button {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.7rem 1rem;
  font: inherit;
  cursor: pointer;
}
/* failClosed() writes the reason into the disabled button, so this state is an
   information carrier and has to stay legible in both schemes. */
button:disabled {
  background: color-mix(in srgb, var(--muted) 22%, var(--bg));
  border-color: var(--muted);
  color: var(--ink);
  cursor: not-allowed;
}
.button, button { border-radius: 6px; transition: filter 120ms ease; }
.button:hover, button:not(:disabled):hover { filter: brightness(1.08); }
.button:active, button:not(:disabled):active { transform: translateY(1px); }
nav a { padding: 0.35rem 0.15rem; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.meta { display: grid; gap: 0.75rem; }
.meta div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
.meta dt { color: var(--muted); }
/* SHA-256 is a 64-character unbroken token. Without this it forces the whole
   document wider than a phone viewport and the digest a tester must compare
   scrolls off-screen. */
.meta dd { margin: 0; overflow-wrap: anywhere; }
code, .mono { overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.status { color: var(--muted); }
.status[data-state="blocked"] { color: var(--danger); }
.drop {
  display: block;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  margin: 1rem 0;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.drop:hover { border-color: var(--accent); }
/* Set while a file is dragged over the zone — the affordance the copy promises. */
.drop[data-dragging] {
  border-color: var(--accent);
  border-style: solid;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.drop-title { display: block; font-size: 1.15rem; font-weight: 700; }
.drop-hint { display: block; color: var(--muted); margin-top: 0.35rem; font-size: 0.95rem; }
.drop input { display: block; margin: 1rem auto 0; max-width: 100%; }
.ceiling { color: var(--muted); }

/* Hashing ~120 MB is long enough that silence reads as a hang. */
.progress { margin: 0.75rem 0; }
.progress .bar {
  height: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.progress .bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 120ms linear;
}

/* The verdict is the whole point of the page, so it is stated in words rather
   than left for the reader to infer by comparing two hex strings. */
.verdict {
  display: grid;
  gap: 0.3rem;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: 6px;
  background: var(--surface);
}
.verdict strong { font-size: 1.1rem; }
.verdict span { color: var(--muted); }
.verdict[data-verdict="match"] { border-left-color: var(--ok); }
.verdict[data-verdict="match"] strong { color: var(--ok); }
.verdict[data-verdict="mismatch"] { border-left-color: var(--danger); }
.verdict[data-verdict="mismatch"] strong { color: var(--danger); }
.verdict[data-verdict="unknown"] { border-left-color: var(--muted); }

.copy-value { overflow-wrap: anywhere; }
.copy-button {
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.6;
  vertical-align: middle;
  background: transparent;
  color: var(--accent);
  border-radius: 4px;
}
.copy-button:hover { background: var(--accent); color: var(--accent-ink); }

/* Two equal buttons implied two equal channels. They are not always equal:
   a build can publish the package to one and only metadata to the other. */
.channels { margin: 1.75rem 0; }
.channels h2 { margin-bottom: 0.35rem; }
[data-channels] { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
[data-channels] li {
  display: grid;
  grid-template-columns: 11rem auto;
  gap: 0.15rem 0.75rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 4px;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
}
[data-channels] strong { grid-column: 1; }
.channel-state { grid-column: 2; font-weight: 700; }
.channel-detail { grid-column: 1 / -1; color: var(--muted); overflow-wrap: anywhere; font-size: 0.95rem; }
[data-channels] li[data-state="package"] { border-left-color: var(--ok); }
[data-channels] li[data-state="package"] .channel-state { color: var(--ok); }
[data-channels] li[data-state="metadata-only"] { border-left-color: var(--muted); }
[data-channels] li[data-state="metadata-only"] .channel-state { color: var(--muted); }
[data-channels] li[data-state="unavailable"] { border-left-color: var(--danger); }
[data-channels] li[data-state="unavailable"] .channel-state { color: var(--danger); }
@media (max-width: 34rem) {
  [data-channels] li { grid-template-columns: 1fr; }
  .channel-state, [data-channels] strong { grid-column: 1; }
}

.next-step {
  margin-top: 2.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.next-step h2 { margin-top: 0; }

/* Artifact-digest table: hashes are wider than a phone, so the table scrolls
   inside its own box instead of dragging the page sideways. */
table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td code { font-size: 0.9em; }

/* Release standing: a tester must never guess which build is installable. */
[data-release-list] { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
[data-release-list] li {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 4px;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
}
[data-release-list] li span { color: var(--muted); }
[data-release-list] li[data-release-state="tip"] { border-left-color: var(--accent); }
[data-release-list] li[data-release-state="tip"] span { color: var(--accent); font-weight: 700; }
[data-release-list] li[data-release-state="withdrawn"] { border-left-color: var(--danger); }
[data-release-list] li[data-release-state="withdrawn"] span { color: var(--danger); }
[data-release-list] li[data-release-state="superseded"] { opacity: 0.75; }

a.button { display: inline-block; text-decoration: none; }

@media (max-width: 34rem) {
  /* Stack label/value so a 64-char digest gets the full column width. */
  .meta div { grid-template-columns: 1fr; gap: 0.15rem; }
  .actions button, .actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .button, button { transition: none; }
  .button:active, button:not(:disabled):active { transform: none; }
}
