/* Warm paper, editorial typography, and generous reading space. */
:root {
  color-scheme: light;
  --ink: #302720;
  --muted: #776d61;
  --accent: #a35130;
  --sage: #426052;
  --line: #e6ddcf;
  --panel: #fffbf5;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 12px 36px #5b40220a;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 14px/1.65 var(--sans);
  background: radial-gradient(ellipse at 0 0, #ead7c18c, transparent 600px),
    radial-gradient(ellipse at 100% 0, #dce3d58c, transparent 680px), #f4efe6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
[hidden] { display: none !important; }
.skip {
  position: fixed; top: -80px; left: 24px; z-index: 10;
  padding: 12px 20px; border-radius: 12px; background: var(--panel);
}
.skip:focus { top: 16px; }

/* The original content and controls keep their existing behavior. */
.hero {
  max-width: 1320px;
  margin: 24px auto 0;
  padding: 24px 32px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  column-gap: 40px;
  border: 1px solid #e8dece;
  border-radius: 30px;
  background: linear-gradient(120deg, #fffaf2, #fbf0e1 78%, #f2eddf);
  box-shadow: var(--shadow);
}
.topline {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line);
  font-size: 10px; letter-spacing: 1.4px; font-weight: 600;
}
.brand { display: flex; align-items: center; gap: 10px; }
.bolt {
  display: inline-grid; place-items: center;
  width: 29px; height: 29px; border: 1px solid #d6bba2;
  border-radius: 10px; color: var(--accent); background: #f4e5d2;
  font-family: Georgia, serif; font-size: 25px; line-height: 1;
}
.divider { margin: 0 4px; color: #b7aa98; font-weight: 400; }
.topline nav { display: flex; gap: 8px; letter-spacing: 0; font-weight: 400; }
.topline nav a {
  padding: 6px 13px; border: 1px solid var(--line);
  border-radius: 99px; font-size: 11px; color: #6e6052;
  background: #fffcf680;
}
.topline nav a:hover { background: #f0e3d2; color: var(--accent); }
.hero-body { padding: 27px 0 0; min-width: 0; }
.eyebrow {
  display: flex; align-items: center; gap: 9px;
  font-size: 9px; letter-spacing: 1.8px; color: var(--accent);
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
h1 {
  margin: 14px 0 12px;
  font: 700 clamp(36px, 3.6vw, 48px)/1.06 var(--serif);
  letter-spacing: -1.9px;
}
h1 span { display: block; color: var(--ink); }
.intro { margin: 0; font-size: 12px; line-height: 1.85; color: var(--muted); }
.hero-note { display: none; }
.metrics {
  align-self: center;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; padding-top: 26px;
}
.metrics > div {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0; padding: 15px 13px; gap: 8px;
  border: 1px solid #e8dece; border-radius: 17px; background: #fffaf2b3;
}
.metrics strong {
  font-family: var(--serif); font-size: 31px; line-height: 1;
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.metrics span { font-size: 9px; letter-spacing: .7px; color: var(--muted); }
.metrics > div:nth-child(2) { background: #e7ebdf; border-color: #d9e0d2; }
.metrics > div:nth-child(2) strong { color: var(--sage); }
.metrics .freshness {
  grid-column: 1 / -1; padding: 12px 16px; gap: 3px;
  background: transparent; border-style: dashed;
}
.metrics .freshness span { font-size: 8px; }
.metrics .freshness strong { font: 500 12px/1.6 var(--sans); }
.freshness small { font-size: 10px; color: var(--muted); }

.layout {
  max-width: 1320px; margin: 22px auto 50px;
  display: grid; grid-template-columns: 258px minmax(0, 1fr);
  gap: 22px; align-items: start;
}
aside {
  position: sticky; top: 22px;
  padding: 24px 14px 22px;
  border: 1px solid var(--line); border-radius: 26px;
  background: #fffaf2d9; box-shadow: var(--shadow);
}
.section-label {
  margin: 0 12px 17px; font-size: 10px;
  font-weight: 500; letter-spacing: 1.6px; color: var(--accent);
}
.topics { display: flex; flex-direction: column; gap: 5px; }
.topic {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 11px 12px; text-align: left;
  border: 1px solid transparent; border-radius: 13px;
  background: transparent; color: #6e665c; font-size: 12px; line-height: 1.5;
  transition: background .15s ease, border-color .15s ease;
}
.topic:hover { background: #f1e9dc; }
.topic.selected {
  color: #994927; background: #f5e6d8; border-color: #e4c9b3; font-weight: 600;
}
.topic .count {
  flex-shrink: 0; min-width: 25px; padding: 1px 5px; border-radius: 99px;
  background: #ede9df; color: #827668; text-align: center;
  font-size: 10px; font-weight: 400; font-variant-numeric: tabular-nums;
}
.topic.selected .count { color: #9a512e; background: #fff7ec; }
.aside-note {
  margin: 22px 12px 0; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 11px; line-height: 1.85; color: var(--muted);
}
.aside-note strong { color: var(--ink); font-size: 12px; font-weight: 500; }
.aside-note p { margin: 8px 0; }
.aside-note a { color: var(--accent); display: inline-block; margin-top: 4px; }
#results { min-width: 0; scroll-margin-top: 24px; }
.search-wrap {
  display: flex; align-items: center; gap: 12px; padding: 0 19px;
  border: 1px solid var(--line); border-radius: 17px;
  background: #fffcf7; box-shadow: 0 4px 14px #5b402205;
}
.search-wrap > span { color: #a58e76; font-size: 29px; line-height: 1; }
.search-wrap input {
  width: 100%; min-width: 0; height: 54px; border: 0; background: transparent;
  color: var(--ink); font-size: 13px;
}
.search-wrap input::placeholder { color: #938777; }
.search-wrap input:focus { outline: none; }
.search-wrap:focus-within { outline: 2px solid #b9784e; outline-offset: 2px; }
.filters {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin: 13px 0 25px;
  color: var(--muted); font-size: 11px;
}
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { width: 14px; height: 14px; accent-color: var(--accent); }
.selects { display: flex; flex-wrap: wrap; gap: 8px; }
.date-filter {
  padding: 17px 20px 13px; margin: -9px 0 22px;
  border: 1px solid var(--line); border-radius: 20px;
  background: #fffaf2d9;
}
.date-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.date-heading h3 { margin: 0; font-size: 12px; font-weight: 500; color: #79553c; }
.date-modes { display: flex; gap: 3px; padding: 3px; border-radius: 99px; background: #f0e8dc; }
.date-modes button {
  padding: 5px 12px; border: 0; border-radius: 99px; background: transparent;
  color: var(--muted); font-size: 11px;
}
.date-modes button[aria-pressed="true"] { background: #fffcf6; color: var(--accent); box-shadow: 0 1px 4px #5b40220d; }
.date-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.date-fields label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.date-fields label > span { color: var(--muted); font-size: 10px; }
.date-fields input {
  width: 176px; min-width: 0; max-width: 100%; min-height: 38px; padding: 7px 10px;
  border: 1px solid #dfd2bf; border-radius: 11px; color: var(--ink);
  background: #fffdf8; font-size: 13px; font-variant-numeric: tabular-nums;
}
.date-fields input[aria-invalid="true"] { border-color: #ad4936; }
.date-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.date-actions button {
  min-height: 38px; padding: 7px 12px; border: 1px solid #dfd2bf; border-radius: 99px;
  background: #fffdf8; color: var(--accent); font-size: 11px;
}
.date-actions button:hover:not(:disabled) { background: #f4e7d6; }
.date-actions button:disabled { opacity: .5; cursor: default; }
.date-info { margin: 11px 0 0; color: #8c7b67; font-size: 10px; }
.date-error { margin: 8px 0 0; color: #a14230; font-size: 12px; }
select {
  max-width: 100%; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: 99px; background: #fffbf4; color: #6b6155; font-size: 11px;
  cursor: pointer;
}
.result-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding: 0 3px; margin-bottom: 15px;
}
.result-heading h2 {
  margin: 0; color: var(--ink); font: 700 27px/1.2 var(--serif); letter-spacing: -.6px;
}
.result-heading > span { flex-shrink: 0; color: var(--muted); font-size: 11px; }
.papers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 17px; }
.paper {
  position: relative; min-width: 0; padding: 25px 28px 20px;
  border: 1px solid #e7ded0; border-radius: 25px;
  background: linear-gradient(130deg, #fffdf8, #fff9f0);
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.paper:hover { border-color: #ceb69c; box-shadow: 0 12px 32px #5b402212; }
.paper-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  color: #8a7966; font-size: 10px; letter-spacing: 1.3px;
  font-variant-numeric: tabular-nums;
}
.new-label {
  padding: 3px 9px; border-radius: 99px;
  background: #eaf0e5; color: #537052; font-size: 8px;
  font-weight: 500; letter-spacing: .7px; white-space: nowrap;
}
.paper h3 {
  margin: 13px 0 8px; font: 700 25px/1.22 var(--serif);
  letter-spacing: -.5px; overflow-wrap: anywhere;
}
.paper h3 a:hover { color: var(--accent); }
.authors { margin: 0 0 13px; font-size: 12px; color: #867b6c; line-height: 1.6; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 15px; }
.tag {
  padding: 3px 9px; border-radius: 99px; color: var(--sage);
  background: #eaf0e5; font-size: 10px; line-height: 1.6;
}
.tag:nth-child(even) { background: #f6e8d9; color: #9a6344; }
.excerpt { margin: 0 0 12px; color: #726858; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.paper details { margin-top: 10px; font-size: 11px; color: var(--muted); }
.paper summary { cursor: pointer; color: var(--accent); width: fit-content; }
.paper details[open] { margin-top: 15px; padding: 15px 18px; border-radius: 16px; background: #f3ebdf; }
.paper details p { font-size: 13px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.paper details small { color: #83715e; }
.paper-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 19px; padding-top: 15px; border-top: 1px solid #ede3d5;
}
.paper-links a {
  padding: 5px 12px; border: 1px solid #e2d7c6; border-radius: 99px;
  color: #695743; background: #fffcf7; font-size: 10px;
}
.paper-links a:hover { color: var(--accent); background: #f5e9da; border-color: #ceae8d; }
.paper-links .id { margin-left: auto; color: #968a79; font-size: 10px; font-variant-numeric: tabular-nums; }
.more {
  display: block; margin: 25px auto 0; padding: 11px 24px;
  border: 1px solid #d7c7b2; border-radius: 99px;
  background: #fffaf2; color: #8e5738; font-size: 12px;
}
.more:hover { background: #efdfca; }
.empty {
  padding: 65px 24px; border: 1px dashed #d7c5ae; border-radius: 25px;
  background: #fffaf299; text-align: center; color: var(--muted);
}
.empty h3 { color: var(--ink); font: 700 26px var(--serif); }
.empty button {
  padding: 10px 18px; border: 1px solid #d9c7ae; border-radius: 99px;
  background: #fffaf2; color: var(--accent); font-size: 12px;
}
.empty a { text-decoration: underline; }
footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px;
  max-width: 1320px; margin: 0 auto; padding: 22px 2px 30px;
  border-top: 1px solid #dfd3c1; color: #8d7e6b; font-size: 10px;
}
footer a { margin-left: 12px; color: var(--accent); }
noscript p { padding: 16px; text-align: center; }

@media (max-width: 1390px) {
  .hero, .layout, footer { margin-left: 30px; margin-right: 30px; }
}
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr) 345px; column-gap: 24px; padding: 22px 27px 27px; }
  .hero, .layout, footer { margin-left: 22px; margin-right: 22px; }
  .layout { grid-template-columns: 224px minmax(0, 1fr); gap: 18px; }
  .metrics > div { padding: 14px 10px; }
  .metrics span { font-size: 7px; letter-spacing: .7px; }
  .topic { padding: 10px; font-size: 11px; }
  .paper { padding: 23px; }
  .paper h3 { font-size: 23px; }
}
@media (max-width: 760px) {
  .hero, .layout, footer { margin-left: 16px; margin-right: 16px; }
  .hero { margin-top: 16px; display: block; padding: 19px 23px 21px; border-radius: 25px; }
  .topline { padding-bottom: 15px; gap: 10px; font-size: 9px; letter-spacing: .7px; }
  .brand { gap: 7px; }
  .brand .divider { margin: 0; }
  .topline nav a { padding: 5px 9px; font-size: 10px; white-space: nowrap; }
  .topline nav a:first-child { display: none; }
  .hero-body { padding-top: 18px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  h1 { font-size: 39px; letter-spacing: -1.6px; margin: 11px 0; }
  .intro { font-size: 11px; }
  .metrics { padding-top: 16px; gap: 8px; }
  .metrics > div { padding: 12px; border-radius: 14px; gap: 5px; }
  .metrics strong { font-size: 28px; }
  .metrics span { font-size: 8px; letter-spacing: .2px; }
  .metrics .freshness { padding: 10px 13px; gap: 2px; }
  .metrics .freshness strong { font-size: 11px; }
  .freshness small { font-size: 9px; }
  .layout { display: block; margin-top: 17px; margin-bottom: 34px; }
  aside { position: static; padding: 17px 14px 10px; margin-bottom: 17px; border-radius: 21px; }
  .section-label { margin: 0 5px 10px; font-size: 9px; }
  .topics { flex-direction: row; overflow-x: auto; padding: 0 0 7px; scrollbar-width: thin; scrollbar-color: #cab69b transparent; }
  .topic { width: auto; flex-shrink: 0; padding: 8px 11px; white-space: nowrap; font-size: 11px; border-radius: 99px; }
  .aside-note { display: none; }
  .search-wrap { padding: 0 14px; border-radius: 15px; }
  .search-wrap input { font-size: 16px; height: 50px; }
  .search-wrap input::placeholder { font-size: 12px; }
  .filters { margin: 12px 0 24px; gap: 12px; font-size: 11px; }
  .selects { width: 100%; gap: 8px; }
  .selects select { flex: 1; min-width: 0; padding: 9px 7px; font-size: 10px; }
  .date-filter { padding: 15px; margin-top: -9px; }
  .date-heading { gap: 8px; flex-wrap: wrap; }
  .date-heading h3 { font-size: 11px; }
  .date-modes button { padding: 6px 10px; font-size: 10px; }
  .date-fields { gap: 10px; }
  .date-fields label { flex: 1 1 125px; }
  .date-fields input { width: 100%; font-size: 16px; padding: 8px; }
  .date-actions { margin-left: 0; flex-basis: 100%; }
  .date-info { font-size: 10px; line-height: 1.7; }
  .result-heading { margin-bottom: 13px; gap: 9px; }
  .result-heading h2 { font-size: 25px; }
  .result-heading > span { font-size: 10px; }
  .papers { gap: 14px; }
  .paper { padding: 21px 21px 17px; border-radius: 22px; }
  .paper h3 { font-size: 23px; line-height: 1.25; }
  .paper-meta { font-size: 9px; }
  .authors { font-size: 11px; }
  .tag { font-size: 9px; }
  .paper-links a { padding: 7px 11px; }
  .paper details { font-size: 12px; }
  .paper summary { padding: 4px 0; }
  footer { padding-top: 17px; font-size: 9px; gap: 8px; }
  footer a { display: block; margin: 5px 0 0; }
}
@media (max-width: 400px) {
  .hero { padding-left: 18px; padding-right: 18px; }
  .topline { font-size: 8px; letter-spacing: .3px; }
  .bolt { width: 24px; height: 25px; font-size: 21px; }
  .eyebrow { font-size: 7px; letter-spacing: 1px; }
  .metrics > div { padding: 11px 8px; }
  .metrics span { font-size: 8px; letter-spacing: .1px; }
  .paper { padding-left: 19px; padding-right: 19px; }
  .paper h3 { font-size: 22px; }
  .paper-links { gap: 6px; }
  .paper-links a { padding: 6px 9px; }
  .paper-links .id { font-size: 9px; }
}
@media (max-height: 820px) and (min-width: 761px) {
  aside { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
