:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --text: #202322;
  --muted: #5e6762;
  --line: #d8ddd7;
  --panel: #ffffff;
  --accent: #27615c;
  --accent-2: #983e33;
  --strong: #165f45;
  --mixed: #86620d;
  --caution: #983e33;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--accent);
}

.site-header,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-weight: 700;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.dek {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px) minmax(135px, 170px) minmax(135px, 170px);
  gap: 12px;
  align-items: end;
  margin-top: 26px;
}

.filter-field {
  min-width: 0;
}

.filter-field-search {
  min-width: min(100%, 300px);
}

.search-label {
  display: block;
  margin: 0 0 8px;
  font-weight: 800;
}

#archive-search,
#archive-period,
#archive-start,
#archive-end {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

#archive-start:disabled,
#archive-end:disabled {
  color: #8b918d;
  background: #eef1ed;
}

main {
  padding: 26px 0 56px;
}

.archive-list {
  display: grid;
  gap: 14px;
}

.archive-card,
.paper {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.archive-card {
  padding: 18px;
}

.loading-card {
  color: var(--muted);
}

.card-top,
.paper-head,
.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.card-top {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.archive-card h2 {
  margin: 10px 0 8px;
  font-size: 1.35rem;
}

.archive-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.archive-card h2 a:hover {
  color: var(--accent);
}

.arxiv-lines {
  display: grid;
  gap: 3px;
  margin: 12px 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f0f4f1;
  color: var(--muted);
  font-size: 0.9rem;
}

.arxiv-lines p {
  margin: 0;
}

.arxiv-lines strong {
  color: var(--text);
}

.tags span,
.label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.label.strong {
  background: #e5f2ec;
  color: var(--strong);
}

.label.mixed {
  background: #f6efd8;
  color: var(--mixed);
}

.label.caution {
  background: #f8e6e2;
  color: var(--caution);
}

.report section {
  margin-bottom: 32px;
}

.report h2 {
  margin: 10px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 1.55rem;
}

.report h3 {
  margin: 24px 0 12px;
  color: var(--accent);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.takeaways {
  padding-left: 1.1rem;
}

.takeaways li + li {
  margin-top: 8px;
}

.paper {
  margin: 12px 0;
  padding: 16px;
}

.paper-head {
  justify-content: space-between;
  align-items: flex-start;
}

.paper h4 {
  flex: 1 1 420px;
  margin: 0;
  font-size: 1.08rem;
}

.meta {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.paper p:last-child {
  margin-bottom: 0;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

mark {
  border-radius: 3px;
  background: #f4d06f;
  color: inherit;
}

@media (max-width: 880px) {
  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .filter-field-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .site-header,
  main {
    width: min(100% - 24px, 1120px);
  }

  .site-header {
    padding-top: 28px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .paper,
  .archive-card {
    padding: 14px;
  }
}
