:root {
  color-scheme: light dark;
  --bg: #fafafa; --fg: #1a1a1a; --muted: #667; --card: #fff; --border: #e2e2e6;
  --accent: #4a6cf7; --danger: #d33;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101014; --fg: #eee; --muted: #99a; --card: #1a1a20; --border: #2a2a33; }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, sans-serif;
}
nav {
  display: flex; gap: 1.2rem; align-items: center; padding: .7rem 1.2rem;
  border-bottom: 1px solid var(--border); background: var(--card);
  position: sticky; top: 0; z-index: 10;
}
nav .brand { font-weight: 700; margin-right: .5rem; }
nav a { color: var(--fg); text-decoration: none; opacity: .8; }
nav a:hover, nav a.active { opacity: 1; color: var(--accent); }
nav .spacer { flex: 1; }
nav .navsearch input { width: 180px; padding: .35rem .7rem; }
main { max-width: 1200px; margin: 0 auto; padding: 1.2rem; }
h1 { font-size: 1.3rem; margin: .5rem 0 1rem; }
h2.month { font-size: 1.05rem; margin: 1.4rem 0 .6rem; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grid a.ph { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--card); }
.grid a.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.person-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; text-align: center; color: var(--fg); text-decoration: none;
}
.person-card img {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  background: var(--border); margin-bottom: 8px;
}
.person-card .noface {
  width: 96px; height: 96px; border-radius: 50%; background: var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; margin-bottom: 8px;
}
.person-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card .count { color: var(--muted); font-size: .85rem; }
button, input[type=text], input[type=password], select {
  font: inherit; padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--fg);
}
button { cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { color: var(--danger); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); white-space: pre-wrap; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.progress { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .5s; }
.photo-wrap { position: relative; display: inline-block; max-width: 100%; }
.photo-wrap img { max-width: 100%; border-radius: 10px; display: block; }
.bbox { position: absolute; border: 2px solid var(--accent); border-radius: 4px; }
.bbox:hover { border-color: #fff; }
.facechips { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.facechips a {
  display: flex; align-items: center; gap: .5rem; padding: .3rem .7rem .3rem .3rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  color: var(--fg); text-decoration: none;
}
.facechips img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.review-banner {
  display: flex; gap: 1rem; align-items: center; padding: .9rem 1.2rem; margin-bottom: 1.2rem;
  background: var(--card); border: 1px solid var(--accent); border-radius: 12px;
  color: var(--fg); text-decoration: none; font-weight: 600;
}
.review-banner:hover { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
h2.section { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 1.6rem 0 .8rem; }
.person-card .name.unnamed { color: var(--accent); font-weight: 500; }
.review-card { max-width: 620px; margin: 2rem auto; text-align: center; }
.review-pair { display: flex; gap: 1.5rem; align-items: center; justify-content: center; }
.review-side img {
  width: 180px; height: 180px; border-radius: 50%; object-fit: cover; background: var(--border);
}
.review-side .name { font-weight: 700; margin-top: .6rem; }
.review-vs { font-size: 1.1rem; white-space: nowrap; }
.person-hero { display: flex; gap: 1.2rem; align-items: center; margin: .5rem 0 1.2rem; }
.person-hero-face { width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  background: var(--border); }
.person-hero-info { flex: 1; min-width: 0; }
.person-hero input#name { font-size: 1.2rem; font-weight: 600; min-width: 220px; }
.tabs { display: flex; gap: .4rem; align-items: center; border-bottom: 1px solid var(--border);
  margin-bottom: 1rem; }
.tab { border: none; background: none; padding: .6rem 1rem; border-radius: 0;
  border-bottom: 2px solid transparent; color: var(--muted); }
.tab.active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.facegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.facecell { aspect-ratio: 1; border-radius: 50%; overflow: hidden; cursor: pointer;
  border: 3px solid transparent; }
.facecell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.facecell.selected { border-color: var(--danger); }
.facecell.selected img { opacity: .6; }
.login-box { max-width: 340px; margin: 15vh auto; }
.login-box input { width: 100%; margin-bottom: .8rem; }
table.kv td { padding: .15rem .8rem .15rem 0; vertical-align: top; }
table.kv td:first-child { color: var(--muted); white-space: nowrap; }
.loadmore { margin: 1.5rem auto; display: block; }
