:root {
  --ink: #20221f;
  --muted: #666a63;
  --paper: #f7f7f5;
  --panel: #ffffff;
  --line: #deded9;
  --accent: #9c231f;
  --accent-dark: #721713;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
a { color: var(--accent-dark); }
[hidden] { display: none !important; }

.landing-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem;
}

.landing-card { width: min(640px, 100%); }
.eyebrow {
  margin: 0 0 .55rem;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.08; }
.landing-card h1 { margin: 0; font-size: clamp(2.8rem, 7vw, 4.6rem); letter-spacing: -.045em; }
.lede { margin: 1.2rem 0 2rem; color: var(--muted); font-size: 1.05rem; line-height: 1.5; }
.article-search label { display: block; margin-bottom: .55rem; font-size: .82rem; font-weight: 750; }
.search-row { display: flex; gap: .65rem; max-width: 600px; }
input { width: 100%; border: 1px solid #b9b5ab; border-radius: .35rem; background: var(--panel); color: var(--ink); padding: .85rem 1rem; }
input:focus { outline: 3px solid rgba(156, 35, 31, .18); border-color: var(--accent); }
button { border: 0; border-radius: .35rem; background: var(--accent); color: white; cursor: pointer; font-weight: 760; padding: .82rem 1.2rem; white-space: nowrap; }
button:hover { background: var(--accent-dark); }
.dataset-note { margin-top: 1.25rem; color: var(--muted); font-size: .86rem; }
.download-link { display: inline-flex; margin-top: 1rem; font-size: .9rem; font-weight: 750; text-underline-offset: .18em; }
.download-link.compact { margin: 0; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: .3rem; background: var(--panel); text-decoration: none; }

.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; padding: .6rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line); background: rgba(247, 247, 245, .96); }
.brand { color: var(--accent); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 800; text-decoration: none; }
.brand span { color: var(--ink); font-family: Inter, sans-serif; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.header-search { display: flex; gap: .4rem; width: min(330px, 48vw); }
.header-search input, .header-search button { padding: .48rem .7rem; font-size: .84rem; }
.article-shell { width: min(1420px, calc(100% - 2rem)); margin: 0 auto; padding: 2.7rem 0 5rem; }
.loading-card, .error-card { margin: 5rem auto; max-width: 620px; padding: 2rem; border: 1px solid var(--line); background: var(--panel); }
.error-card h1 { margin: 0 0 1rem; font-size: 2.6rem; }
.article-title-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.article-title-row h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 5.2rem); letter-spacing: -.045em; }
.article-meta { margin: .75rem 0 0; color: var(--muted); font-size: .88rem; }
.panel { margin-top: 1rem; padding: 1.35rem; border: 1px solid var(--line); background: var(--panel); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.panel-heading h2 { margin: 0; font-size: 1.75rem; }
.method-label { max-width: 520px; margin: 0; color: var(--muted); font-size: .78rem; text-align: right; }
.ownership-bar { display: flex; width: 100%; height: 18px; overflow: hidden; border-radius: 999px; background: #e4e1da; }
.ownership-bar span { min-width: 2px; }
.owner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .55rem 1rem; margin-top: 1.2rem; }
.owner-card { display: grid; grid-template-columns: 12px 1fr auto; grid-template-areas: "swatch name percent" "swatch role tokens"; align-items: center; column-gap: .55rem; padding: .45rem 0; border-bottom: 1px solid #ece9e1; font-size: .83rem; }
.owner-swatch { grid-area: swatch; width: 10px; height: 100%; min-height: 28px; border-radius: 999px; }
.owner-name { grid-area: name; overflow: hidden; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.owner-role { grid-area: role; color: var(--muted); font-size: .72rem; }
.owner-percent { grid-area: percent; font-variant-numeric: tabular-nums; }
.owner-tokens { grid-area: tokens; color: var(--muted); font-size: .72rem; text-align: right; }
.token-stream { max-width: 84ch; font-family: Georgia, "Times New Roman", serif; font-size: 1.06rem; line-height: 1.75; }
.analysis-segment { padding: .17em .12em .2em; border-radius: .16em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.token-stream p { margin: 0 0 1.15em; }
.token-stream h2, .token-stream h3, .token-stream h4 {
  margin: 1.6em 0 .55em;
  font-size: 1.35rem;
  line-height: 1.25;
}
.token-stream h2:first-child { margin-top: 0; }
.token-stream blockquote { margin: 1.2em 0; padding-left: 1rem; border-left: 2px solid var(--line); color: var(--muted); }
.article-list { padding-left: 1.15rem; }
.article-list::before { float: left; margin-left: -1rem; content: "•"; }
.article-list-ol::before { content: "1."; }
.tok, .analysis-segment { padding: .12em .08em .15em; border-radius: .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.token-diff-link { color: inherit; text-decoration: none; }
.token-diff-link:hover .tok, .token-diff-link:focus .tok { outline: 2px solid currentColor; outline-offset: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  .landing-card h1 { font-size: clamp(2.8rem, 15vw, 4.5rem); }
  .search-row, .panel-heading, .article-title-row { align-items: stretch; flex-direction: column; }
  .method-label { text-align: left; }
  .header-search { width: 55vw; }
  .brand span { display: none; }
  .article-shell { width: min(100% - 1rem, 1420px); padding-top: 1.5rem; }
  .panel { padding: 1rem; }
}
