:root {
  --ink: #14110e;
  --ink-2: #221c16;
  --panel: #1c1914;
  --line: #3a3329;
  --brass: #e2b56a;
  --brass-dim: #a68445;
  --paper: #f4efe4;
  --paper-ink: #221c16;
  --muted: #b3a794;
  --muted-2: #7d7264;
  --danger: #8c2f2f;
  --warn: #8a5a12;
  --ok: #1f6b4a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(226, 181, 106, 0.08), transparent 55%),
    var(--ink);
  color: #f3efe4;
}

a { color: var(--brass); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #f0d7a6; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 0.5rem 0.8rem;
}
.skip:focus { top: 0.5rem; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.4rem 1.5rem 1rem;
  max-width: 1120px;
  margin: 0 auto;
}

.brand { display: flex; gap: 0.85rem; align-items: center; }

.mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 7px;
  background:
    linear-gradient(var(--brass), var(--brass)) 8px 7px / 8px 16px no-repeat,
    linear-gradient(#f3efe4, #f3efe4) 18px 7px / 4px 16px no-repeat,
    var(--ink-2);
  border: 1px solid var(--line);
}

.wordmark {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  font-size: 1.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
}

.tag, .header-note, .panel-note {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.header-note { margin: 0 0 0.2rem; }

.disclaimer, .sample-banner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.disclaimer {
  background: #2a2116;
  color: #f0d7a6;
  border-top: 1px solid var(--brass-dim);
  border-bottom: 1px solid var(--brass-dim);
  font-size: 0.95rem;
}

.sample-banner {
  background: #2a2618;
  color: #f3efe4;
  border-bottom: 1px solid var(--line);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
}

.lookup label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.lookup-row { display: flex; gap: 0.6rem; }

input, button {
  font: inherit;
  color: inherit;
}

input {
  flex: 1;
  min-width: 0;
  background: #100e0c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
}

button {
  background: var(--brass);
  color: #1a140c;
  border: 0;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: progress; }
button:hover:not(:disabled) { background: #f0d7a6; }

.form-error { color: #f0b4b4; margin: 0.55rem 0 0; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
  align-items: start;
}

.feed-panel, .report-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  min-height: 24rem;
}

.panel-head { padding: 1rem 1rem 0.4rem; }
.panel-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }

.feed { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.6rem; }

button.pair {
  text-align: left;
  background: transparent;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  font-weight: 500;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.7rem;
  align-items: center;
}

button.pair:hover,
button.pair.is-selected {
  background: #262119;
  color: inherit;
  border-color: var(--line);
}

.pair .symbol { font-weight: 700; }
.pair .mint { color: var(--muted); font-size: 0.82rem; grid-column: 1 / -1; font-variant-numeric: tabular-nums; }
.score-pill {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  background: #2c2822;
}

.band-fewer_flags { color: #9dccb4; }
.band-some_flags { color: #e2c07a; }
.band-elevated_flags { color: #e2a36a; }
.band-many_flags { color: #e7a0a0; }
.band-unknown { color: var(--muted); }

.empty, .loading {
  color: var(--muted);
  padding: 0.4rem 0.5rem 1rem;
  margin: 0;
}

.report-panel { background: var(--paper); color: var(--paper-ink); }
.report-panel .panel-note, .report-panel .empty { color: #6d6256; }
.report-panel h2 { color: var(--paper-ink); }

.report { padding: 0.2rem 1rem 1.1rem; }

.report-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px solid #e2d8c6;
  padding-bottom: 0.9rem;
}

.report h3 { margin: 0; font-family: Palatino, Georgia, serif; font-size: 1.7rem; font-weight: 600; }
.meta { margin: 0.3rem 0 0; color: #6d6256; font-size: 0.9rem; }
.mint-line { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.score-block { text-align: right; }
.score-block strong {
  display: block;
  font-size: 2.6rem;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  font-family: Palatino, Georgia, serif;
}
.score-block span { font-size: 0.85rem; letter-spacing: 0.04em; }

.ink-fewer_flags { color: var(--ok); }
.ink-some_flags { color: var(--warn); }
.ink-elevated_flags { color: #9a3412; }
.ink-many_flags { color: var(--danger); }
.ink-unknown { color: #5c564c; }

.links { display: flex; gap: 0.8rem; margin: 0.8rem 0; font-size: 0.92rem; }
.note {
  background: #efe6d4;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin: 0.6rem 0;
  font-size: 0.92rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.card {
  border: 1px solid #e2d8c6;
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  background: #fbf7ef;
}

.card h4 { margin: 0 0 0.45rem; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.card p { margin: 0.25rem 0; overflow-wrap: anywhere; }
.card ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.card li { margin: 0.2rem 0; }

.bar {
  height: 8px;
  background: #e6dccb;
  border-radius: 99px;
  overflow: hidden;
  margin: 0.2rem 0 0.55rem;
}
.bar span {
  display: block;
  height: 100%;
  background: #8a5a12;
}

.wide { grid-column: 1 / -1; }

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1rem; }

.legal { max-width: 760px; }
.legal h1 { font-family: Palatino, Georgia, serif; font-weight: 600; margin-bottom: 0.4rem; }
.legal h2 { font-size: 1.05rem; margin-top: 1.4rem; }
.legal p { line-height: 1.55; color: #f3efe4; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

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

.consent { display: none; }

html.needs-consent body { overflow: hidden; }

html.needs-consent .consent {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 1rem;
  background: rgba(10, 8, 6, 0.72);
  overflow: auto;
}

.consent-dialog {
  width: min(36rem, 100%);
  max-height: min(92dvh, 40rem);
  overflow: auto;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 16px;
  padding: 1.25rem 1.3rem 1.3rem;
  box-shadow: var(--shadow);
}

.consent-dialog h2 {
  font-family: Palatino, Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
}

.consent-dialog p { line-height: 1.5; margin: 0.4rem 0 0.8rem; }
.consent-dialog a { color: #6b4e16; }
.consent-dialog .form-error { color: var(--danger); }

.consent-check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0.2rem 0 0.8rem;
  font-size: 1rem;
}

.consent-check input {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  padding: 0;
  accent-color: #6b4e16;
}

#consent-accept { width: 100%; min-height: 48px; }

@media (max-width: 800px) {
  .site-header, .site-footer { flex-direction: column; align-items: flex-start; }
  .layout, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .lookup-row { flex-direction: column; }
  .report-top { flex-direction: column; }
  .score-block { text-align: left; }
  main, .feed-panel, .report-panel, .card { min-width: 0; }
  html.needs-consent .consent { align-items: end; padding: 0; }
  .consent-dialog {
    width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}
