:root {
  --teal: #0f766e;
  --teal-dark: #0c5c56;
  --ink: #1a2624;
  --ink-soft: #4b5a57;
  --bg: #fbfaf8;
  --card: #ffffff;
  --border: #e5e2dc;
  --radius: 12px;
  --amber: #b45309;
  --red: #b91c1c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  line-height: 1.15;
  margin: 0 0 12px;
}

h1 { font-size: clamp(1.8rem, 4.5vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); text-align: center; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 16px; }

.sub {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

code, .mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85em;
  word-break: break-all;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.wordmark {
  font-weight: 700;
  color: var(--teal-dark);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

/* Hero */
.hero {
  padding: 64px 0 48px;
  text-align: center;
  background: linear-gradient(180deg, #eef8f6 0%, var(--bg) 100%);
}

.hero .wrap { max-width: 760px; }

/* Sections */
section { padding: 56px 0; }
section:nth-of-type(even) { background: var(--card); }
.section-note {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 680px;
  margin: -8px auto 28px;
}

/* Tables */
.table-scroll { overflow-x: auto; }
table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 20px;
  font-size: 0.92rem;
  min-width: 560px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  font-weight: 700;
}
tr.hl-lease td:first-child, tr.hl-seat td:first-child,
tr.hl-envelope td:first-child, tr.hl-commandmode td:first-child,
tr.hl-email td:first-child, tr.hl-boot td:first-child,
tr.hl-identity td:first-child, tr.hl-lineage td:first-child {
  border-left: 3px solid var(--teal);
  padding-left: 9px;
}

/* Receipt card */
.receipt-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 720px;
  margin: 32px auto 0;
}
.receipt-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  align-items: start;
}
.receipt-row:last-child { border-bottom: none; }
.receipt-key {
  font-weight: 700;
  color: var(--teal-dark);
  font-size: 0.85rem;
}
.receipt-val { font-size: 0.9rem; }
.receipt-explain {
  font-size: 0.82rem;
  color: var(--ink-soft);
  grid-column: 1 / -1;
  margin-top: -2px;
}
.badge {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Cards / grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
section:nth-of-type(even) .card { background: var(--bg); }

/* Claims grid */
.claims-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.claim-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
}
section:nth-of-type(even) .claim-card { background: var(--card); }
.claim-num {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--border);
  line-height: 1;
}
.claim-text {
  font-size: 0.98rem;
  margin: 0 40px 14px 0;
  font-weight: 600;
}
.claim-meta {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.claim-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.82rem;
}
.claim-key {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
  font-weight: 700;
  padding-top: 2px;
}
.claim-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--ink);
}

.ruling-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.ruling-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.ruling-list .cp-id {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.failure-list { padding: 0; margin: 24px 0 0; list-style: none; }
.failure-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.failure-item .what { font-weight: 700; margin-bottom: 4px; }
.failure-item .handling { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }

.verifier-list { padding: 0; margin: 24px 0 0; list-style: none; }
.verifier-item {
  display: grid;
  grid-template-columns: auto 90px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.verifier-item:last-child { border-bottom: none; }
.v-pass { color: var(--teal-dark); font-weight: 700; }
.v-fail { color: var(--red); font-weight: 700; }
.v-check { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.82rem; }
.v-note { font-size: 0.88rem; color: var(--ink-soft); }

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 28px 0;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  text-align: center;
  min-width: 150px;
}
.stat .num { font-size: 1.6rem; font-weight: 800; color: var(--teal-dark); }
.stat .lbl { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.disclaimer {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.92rem;
  max-width: 720px;
  margin: 20px auto 0;
}

.code-block {
  background: var(--ink);
  color: #d7f5ef;
  border-radius: 10px;
  padding: 16px 18px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  overflow-x: auto;
  max-width: 720px;
  margin: 20px auto 0;
}

/* Anchor hash rows (copyable) */
.hash-list {
  max-width: 820px;
  margin: 20px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hash-row {
  background: var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 12px;
}
.hash-row .hash-label {
  color: #9fd8cf;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hash-row .hash-value {
  color: #d7f5ef;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  white-space: nowrap;
}
.hash-row .copy-btn {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.hash-row .copy-btn:hover { background: var(--teal-dark); }
.hash-row .copy-btn.copied { background: #166534; }
@media (max-width: 640px) {
  .hash-row { grid-template-columns: 1fr; }
  .hash-row .copy-btn { justify-self: start; }
}

/* Stranger walkthrough */
.walkthrough-list {
  max-width: 760px;
  margin: 20px auto 0;
  padding-left: 0;
  list-style: none;
  counter-reset: wt;
}
.walkthrough-list li {
  counter-increment: wt;
  position: relative;
  padding: 10px 0 10px 44px;
  border-bottom: 1px solid var(--border);
}
.walkthrough-list li:last-child { border-bottom: none; }
.walkthrough-list li::before {
  content: counter(wt);
  position: absolute;
  left: 0;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.walkthrough-list .wt-step { font-weight: 600; }
.walkthrough-list .wt-detail { color: var(--ink-soft); font-size: 0.92rem; margin-top: 2px; }
.walkthrough-list .wt-min { color: var(--teal-dark); font-size: 0.8rem; font-weight: 700; margin-left: 8px; }

/* Footer */
.site-footer {
  padding: 28px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
.site-footer p { margin: 0 0 6px; }
.site-footer .tagline { font-style: italic; }

@media (max-width: 600px) {
  .receipt-row { grid-template-columns: 1fr; }
  .verifier-item { grid-template-columns: 1fr; }
}
