:root {
  color-scheme: light;
  --bg: #f8fafb;
  --ink: #1d252c;
  --muted: #65717b;
  --line: #d9e0e5;
  --accent: #0f766e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 22px 16px 56px;
}

h1 {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.25;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

button {
  min-width: 72px;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.answer {
  margin-top: 22px;
  white-space: pre-wrap;
  line-height: 1.65;
}

.sources {
  margin-top: 22px;
}

.source-list {
  border-top: 1px solid var(--line);
}

.source-list summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.source {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.source-list .source:first-of-type {
  border-top: 0;
}

.source h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.45;
}

.source p {
  margin: 0;
  line-height: 1.6;
}

.meta {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.timestamp {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.timestamp:hover {
  text-decoration: underline;
}

.empty {
  color: var(--muted);
}

@media (max-width: 520px) {
  main {
    padding-top: 16px;
  }

  h1 {
    font-size: 24px;
  }

  .input-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
