@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}

/* SoldOut tokens (mirrors the app's V02 palette). */
:root {
  --red: #ff4848;
  --red-strong: #e0353a;
  --red-soft: #fff0f0;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-muted: #f3f3f5;
  --border: #e7e7ea;
  --text: #121214;
  --text-muted: #5d5d66;
  --pass: #15803d;
  --pass-soft: #ecfdf3;
  --fail: #c81e1e;
  --fail-soft: #fff1f1;
  --pending: #a16207;
  --pending-soft: #fffbeb;
  --info: #3f3f46;
  --info-soft: #f4f4f5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 16, 20, 0.04);
  --focus: 0 0 0 3px rgba(255, 72, 72, 0.35);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --red-soft: #2a1314;
    --bg: #000000;
    --surface: #111113;
    --surface-muted: #1a1a1d;
    --border: #2a2a2f;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --pass: #4ade80;
    --pass-soft: #0f2418;
    --fail: #f87171;
    --fail-soft: #2a1212;
    --pending: #fbbf24;
    --pending-soft: #2a210c;
    --info: #d4d4d8;
    --info-soft: #1c1c20;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--red-strong); }
@media (prefers-color-scheme: dark) { a { color: var(--red); } }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; }
.mono { overflow-wrap: anywhere; word-break: break-all; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 16px; z-index: 10; box-shadow: var(--focus); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.site-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand img { display: block; height: 28px; width: auto; }
.site-tag { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; padding-left: 12px; border-left: 1px solid var(--border); }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
main:focus { box-shadow: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h1, .card h2 { margin: 0 0 6px; line-height: 1.25; }
h1 { font-size: clamp(1.45rem, 5vw, 1.9rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.12rem; font-weight: 800; }
h3 { font-size: 0.98rem; font-weight: 700; margin: 18px 0 8px; }
.lead { color: var(--text-muted); margin: 0 0 16px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.86rem; }

/* Overall verdict */
.verdict { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius); padding: 16px; margin: 4px 0 16px; border: 1px solid transparent; }
.verdict .icon { flex: none; width: 28px; height: 28px; margin-top: 2px; }
.verdict-title { font-weight: 800; font-size: 1.12rem; margin: 0; }
.verdict-detail { margin: 4px 0 0; }
.verdict[data-state="verified"] { background: var(--pass-soft); border-color: color-mix(in srgb, var(--pass) 30%, transparent); }
.verdict[data-state="verified"] .verdict-title { color: var(--pass); }
.verdict[data-state="failed"] { background: var(--fail-soft); border-color: color-mix(in srgb, var(--fail) 30%, transparent); }
.verdict[data-state="failed"] .verdict-title { color: var(--fail); }
.verdict[data-state="pending"], .verdict[data-state="running"] { background: var(--pending-soft); border-color: color-mix(in srgb, var(--pending) 30%, transparent); }
.verdict[data-state="pending"] .verdict-title, .verdict[data-state="running"] .verdict-title { color: var(--pending); }
.verdict[data-state="incomplete"], .verdict[data-state="void"] { background: var(--info-soft); border-color: var(--border); }

/* Terms */
.terms { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 14px 0 4px; }
.side { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-muted); }
.side[data-landed="true"] { border-color: var(--red); background: var(--red-soft); }
.side .label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.side .amount { font-size: clamp(1.05rem, 5.2vw, 1.3rem); font-weight: 800; overflow-wrap: anywhere; }
.side .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 0.74rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--surface); border: 1px solid var(--border); }
.tag.red { background: var(--red); color: #fff; border-color: var(--red); }

/* Actions */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
button, .button {
  font: inherit; font-weight: 700; font-size: 0.95rem; border-radius: var(--radius); padding: 12px 16px; min-height: 48px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
button.primary { background: var(--red); border-color: var(--red); color: #fff; flex: 1 1 100%; }
button.primary:hover { background: var(--red-strong); }
button:disabled { opacity: 0.6; cursor: progress; }
@media (min-width: 560px) { button.primary { flex: 0 1 auto; } }

/* Checks */
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.pill { font-size: 0.78rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill[data-state="pass"] { background: var(--pass-soft); color: var(--pass); }
.pill[data-state="fail"] { background: var(--fail-soft); color: var(--fail); }
.pill[data-state="pending"] { background: var(--pending-soft); color: var(--pending); }
.pill[data-state="unavailable"], .pill[data-state="skipped"], .pill[data-state="info"] { background: var(--info-soft); color: var(--info); }
.checks { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px; border-top: 1px solid var(--border); }
.checks li:first-child { border-top: none; }
.checks .icon { width: 20px; height: 20px; margin-top: 2px; }
.checks .label { font-weight: 600; overflow-wrap: anywhere; }
.checks .detail { color: var(--text-muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.state-word { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 6px; }
[data-state="pass"] > .icon, .state-pass { color: var(--pass); }
[data-state="fail"] > .icon, .state-fail { color: var(--fail); }
[data-state="pending"] > .icon, .state-pending { color: var(--pending); }
[data-state="unavailable"] > .icon, [data-state="skipped"] > .icon, .state-unavailable, .state-skipped { color: var(--info); }

/* Facts */
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 12px 0 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.facts div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 12px; border-top: 1px solid var(--border); }
.facts div:first-child { border-top: none; }
.facts dt { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 560px) { .facts div { grid-template-columns: 180px 1fr; gap: 12px; } }

details { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 12px; background: var(--surface-muted); }
summary { cursor: pointer; padding: 12px; font-weight: 700; min-height: 44px; }
details pre { margin: 0; padding: 12px; overflow: auto; max-height: 320px; font-size: 0.8rem; border-top: 1px solid var(--border); white-space: pre-wrap; word-break: break-all; }

ol.steps { padding-left: 1.3em; margin: 8px 0 0; }
ol.steps li { margin: 6px 0; }
.notice { border-left: 3px solid var(--red); padding: 8px 12px; background: var(--red-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 12px 0 0; }

form.lookup { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
form.lookup input { flex: 1 1 240px; font: inherit; padding: 12px 14px; min-height: 48px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.file-drop { display: block; margin-top: 12px; border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop:focus-within { box-shadow: var(--focus); }

.site-footer { color: var(--text-muted); font-size: 0.86rem; text-align: center; padding: 20px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: var(--surface); }
.site-footer p { margin: 4px auto; max-width: 640px; }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
