:root {
  --bg: #f7f4ee;
  --ink: #1a1a1a;
  --muted: #666;
  --accent: #b85c2c;
  --line: #d8d2c4;
  --card: #fff;
  --shadow: 0 1px 3px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }

header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none;
  letter-spacing: -0.02em;
}
.brand .logo {
  font-family: Georgia, 'Times New Roman', serif;
  background: linear-gradient(135deg, var(--accent) 0%, #d97a3d 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
header nav a {
  color: var(--muted); text-decoration: none; margin-left: 20px; font-size: 14px;
  font-family: system-ui, -apple-system, sans-serif;
}
header nav a:hover { color: var(--accent); }

.hero { padding: 60px 0 32px; text-align: center; }
.hero h1 {
  font-size: 48px; line-height: 1.1; margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.lede { font-size: 18px; color: #333; max-width: 580px; margin: 0 auto 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 28px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); font-size: 14px; }

input[type=search], input[type=text], select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 12px;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row > * { flex: 1 1 200px; margin-top: 0; }

button {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 14px;
  cursor: pointer;
}
button.active, button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
#pgo { background: var(--accent); color: #fff; border-color: var(--accent); flex: 0 0 auto; }

.chips { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 6px; }

#results { margin-top: 12px; max-height: 480px; overflow-y: auto; }
.result {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 8px;
  background: #fafaf7;
}
.result .name { font-weight: 700; }
.result .meta { color: var(--muted); font-size: 13px; margin-top: 4px;
  font-family: system-ui, -apple-system, sans-serif; }
.result .tt { font-family: 'SF Mono', Menlo, monospace; font-size: 14px; color: var(--accent); }

#prediction {
  margin-top: 16px;
  padding: 16px;
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: none;
}
#prediction.show { display: block; }
#prediction h3 { margin: 0 0 8px; font-size: 18px; }
#prediction .big { font-size: 28px; color: var(--accent); font-weight: 700; }
#prediction dl { margin: 8px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px;
  font-family: system-ui, -apple-system, sans-serif; font-size: 14px; }
#prediction dt { color: var(--muted); }
#prediction dd { margin: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
}
table th, table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table th { background: #fafaf7; font-weight: 600; }

.book p { font-size: 16px; }
.book strong { color: var(--accent); }

footer {
  margin: 60px 0 20px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
}
footer a { color: var(--muted); }

@media (max-width: 620px) {
  .hero h1 { font-size: 36px; }
  .card { padding: 20px 16px; }
}
