:root {
  color-scheme: light;
  --ink: #152033;
  --muted: #607086;
  --line: #d9e2ec;
  --soft: #f5f8fb;
  --panel: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --mark: #fff1a6;
  --shadow: 0 18px 45px rgba(17, 31, 54, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #eef3f8;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 20px;
}

.search-panel,
.answer-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 28px;
}

.answer-panel {
  min-height: calc(100vh - 80px);
  padding: 28px;
}

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

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.search-form {
  margin-top: 28px;
}

.search-form label,
.filters label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-row input,
.filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--ink);
  outline: none;
}

.search-row input:focus,
.filters select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.search-row button,
.quick-filters button,
.action-grid button,
.save-button,
.link-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.search-row button,
.action-grid button {
  flex: 0 0 auto;
  padding: 0 16px;
  color: white;
  background: var(--accent);
  font-weight: 800;
}

.search-row button:hover,
.action-grid button:hover {
  background: var(--accent-dark);
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.quick-filters button,
.hot-keywords-list button,
.save-button,
.link-button {
  padding: 8px 10px;
  color: var(--accent-dark);
  background: #dfefff;
  font-weight: 800;
}

.hot-keywords {
  margin-top: 18px;
}

.hot-keywords-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.hot-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 164px;
  overflow: auto;
  padding-right: 4px;
}

.hot-keywords-list button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
}

.hot-keywords-list span {
  color: var(--muted);
  font-weight: 700;
}

.empty-keywords {
  color: var(--muted);
  font-size: 0.9rem;
}

.filters {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.filters label:not(:first-child) {
  margin-top: 8px;
}

.action-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.action-grid button,
.nav-button {
  min-height: 44px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: white;
  background: #15803d;
  font-weight: 800;
  text-decoration: none;
}

.nav-button:hover {
  background: #166534;
}

#clear-button {
  color: var(--accent-dark);
  background: #dfefff;
}

#clear-button:hover {
  background: #cde3ff;
}

#schedule-button {
  color: #7a4c00;
  background: #ffe8ae;
}

#schedule-button:hover {
  background: #ffd978;
}

.status {
  color: var(--muted);
  font-weight: 700;
}

.answer {
  margin: 0 0 22px;
  padding: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.55;
}

.answer:empty {
  display: none;
}

.results {
  display: grid;
  gap: 12px;
}

.paper-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.paper-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.paper-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.save-button.saved {
  color: #7a4c00;
  background: #ffe8ae;
}

.meta,
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.badge-oral,
.badge-best-paper,
.badge-outstanding-paper {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fecaca;
  font-weight: 800;
}

.badge-spotlight {
  color: #713f12;
  background: #fef3c7;
  border-color: #fde68a;
  font-weight: 800;
}

.badge-regular {
  color: #14532d;
  background: #dcfce7;
  border-color: #bbf7d0;
  font-weight: 800;
}

.badge-poster {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #bfdbfe;
  font-weight: 800;
}

.authors,
.topic,
.keywords {
  margin-top: 10px;
  line-height: 1.45;
}

.authors {
  color: var(--ink);
  font-weight: 700;
}

.topic,
.keywords {
  color: var(--muted);
}

.abstract {
  margin: 10px 0 0;
  color: #334155;
  line-height: 1.55;
}

.abstract-details {
  margin-top: 10px;
}

.abstract-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 800;
}

.abstract-details p {
  margin: 10px 0 0;
  color: #334155;
  line-height: 1.58;
}

.links {
  margin-top: 12px;
}

.link-button {
  text-decoration: none;
}

mark {
  background: var(--mark);
  border-radius: 3px;
  padding: 0 2px;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .search-panel {
    position: static;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .search-panel,
  .answer-panel {
    padding: 18px;
  }

  .search-row,
  .paper-header {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .search-row button,
  .save-button {
    min-height: 44px;
    width: 100%;
  }
}
