:root {
  --bg: #f7f5f1; --surface: #ffffff; --surface-2: #f0ede7; --fg: #1d1b18; --muted: #6d6860;
  --line: #e3dfd7; --accent: #006600; --accent-fg: #ffffff; --accent-soft: #e5f0e3; --gold: #ffcc00; --bar: #006600; --bar-fg: #ffffff;
  --ok: #2e6b47; --warn: #9a5a00; --danger: #9a2a2a; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --radius: 10px; --serif: "Lora", Georgia, "Times New Roman", serif; --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151413; --surface: #1f1d1b; --surface-2: #2a2825; --fg: #ecebe7; --muted: #a39f97;
    --line: #36332f; --accent: #7ccf7c; --accent-fg: #0b1a0b; --accent-soft: #1f3320; --gold: #ffd633; --bar: #0f3d12; --bar-fg: #f2f5ef;
    --ok: #7cc39a; --warn: #e3b060; --danger: #e48b8b; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151413; --surface: #1f1d1b; --surface-2: #2a2825; --fg: #ecebe7; --muted: #a39f97;
  --line: #36332f; --accent: #7ccf7c; --accent-fg: #0b1a0b; --accent-soft: #1f3320; --gold: #ffd633; --bar: #0f3d12; --bar-fg: #f2f5ef;
  --ok: #7cc39a; --warn: #e3b060; --danger: #e48b8b; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--sans); }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 30px; margin: 4px 0 6px; line-height: 1.15; }
h2 { font-size: 21px; margin: 28px 0 10px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
[hidden] { display: none !important; }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--bar); color: var(--bar-fg); border-bottom: 3px solid var(--gold); }
.brand { font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--bar-fg); text-decoration: none; }
.brand span { color: var(--gold); font-weight: 400; }
.envtag { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--gold); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a { color: var(--bar-fg); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
nav a:hover { background: rgba(255,255,255,.12); }
nav a.on { background: rgba(255,255,255,.16); color: var(--bar-fg); font-weight: 600; box-shadow: inset 0 -2px 0 var(--gold); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--bar-fg); opacity: .92; }
.who .btn { background: transparent; color: var(--bar-fg); border-color: rgba(255,255,255,.35); }
.who img { width: 26px; height: 26px; border-radius: 50%; }

main { max-width: 1120px; margin: 0 auto; padding: 20px 20px 80px; }
.banner { max-width: 1120px; margin: 14px auto 0; padding: 12px 16px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--line); font-size: 14px; width: calc(100% - 40px); }
.banner b { color: var(--accent); }
.banner { border-left: 4px solid var(--gold); }

/* ---- buttons & inputs ---- */
button, .btn { font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=email], input[type=search], input[type=password], select, textarea {
  font: inherit; font-size: 15px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); width: 100%; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }

/* ---- sign in ---- */
.signin { max-width: 420px; margin: 8vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.signin h1 { color: var(--accent); }
.signin .or { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 6px; }
.signin form { display: grid; gap: 8px; }
.signin .dev { margin-top: 22px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* ---- home ---- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.search { max-width: 420px; flex: 1; min-width: 240px; }
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.classes a { display: block; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--fg); box-shadow: var(--shadow); }
.classes a:hover { border-color: var(--accent); }
.classes b { display: block; font-family: var(--serif); font-size: 19px; }
.classes span { font-size: 12px; color: var(--muted); }

/* ---- people grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 14px; }
.card { display: block; text-decoration: none; color: var(--fg); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card .ph { aspect-ratio: 3 / 4; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.initials { font-family: var(--serif); font-size: 30px; color: var(--muted); }
.card .cap { padding: 8px 10px 10px; }
.card .cap b { display: block; font-size: 14px; line-height: 1.25; }
.card .cap span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.claimed { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-left: 4px; vertical-align: middle; }

/* ---- person ---- */
.person-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.person-head .lead { width: 150px; flex: none; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 3/4; display: grid; place-items: center; cursor: zoom-in; border: 0; padding: 0; }
.person-head .lead img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-head .info { flex: 1; min-width: 240px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tag.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.shot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shot button.ph { width: 100%; border: 0; padding: 0; border-radius: 0; aspect-ratio: 3/4; background: var(--surface-2); cursor: zoom-in; display: grid; place-items: center; }
.shot button.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .locked { aspect-ratio: 3/4; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; padding: 10px; background: var(--surface-2); }
.shot .cap { padding: 8px 10px 10px; font-size: 13px; }
.shot .cap b { display: block; }
.shot .cap span { color: var(--muted); font-size: 12px; }
.seniorpage { max-width: 520px; }
.seniorpage button { border: 0; padding: 0; background: none; cursor: zoom-in; width: 100%; }
.seniorpage img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }

/* ---- viewer (slideshow) ---- */
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(12, 11, 10, .94); color: #f2f0ec; display: grid;
  grid-template-rows: auto 1fr auto; }
.viewer .vbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; gap: 10px; }
.viewer .stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 56px; touch-action: pan-y; }
.viewer .stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.viewer .vcap { text-align: center; padding: 12px 16px 20px; font-size: 14px; }
.viewer .vcap b { font-family: var(--serif); font-size: 18px; display: block; }
.viewer button { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #f2f0ec; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; justify-content: center; font-size: 20px; padding: 0; }
.viewer .prev { left: 8px; } .viewer .next { right: 8px; }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.3); }
.dots i.on { background: #fff; }

/* ---- dialog ---- */
.dialog-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--surface); border-radius: 14px; padding: 22px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog h2 { margin-top: 0; }
.dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---- forms: privacy ---- */
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt input { margin-top: 3px; }
.opt b { display: block; font-size: 14px; }
.opt span { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.picker-results { display: grid; gap: 4px; margin-top: 6px; max-height: 220px; overflow: auto; }
.picker-results button { justify-content: space-between; width: 100%; }
.savebar { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.switch { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ---- admin ---- */
.queue { display: grid; gap: 12px; }
.req { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; flex-wrap: wrap; }
.req .ph { width: 72px; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; background: var(--surface-2); flex: none; display: grid; place-items: center; }
.req .ph img { width: 100%; height: 100%; object-fit: cover; }
.req .body { flex: 1; min-width: 220px; }
.req .acts { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 70; }

@media (max-width: 640px) {
  .top { padding: 8px 12px; gap: 8px; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  main { padding: 14px 16px 60px; }
  .banner { width: calc(100% - 32px); }
  h1 { font-size: 25px; }
  .grid, .timeline { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .person-head .lead { width: 110px; }
  .viewer .stage { padding: 0 8px; }
  .viewer .nav { display: none; }
}
.wide { width: 100%; justify-content: center; }
.danger-text { color: var(--danger); }
.prose { max-width: 720px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.signin .foot { margin-top: 18px; font-size: 12px; text-align: center; }
.contact { max-width: 560px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.req.done { opacity: .6; }
.msg { white-space: pre-wrap; margin: 8px 0; }
.candids { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.candid { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.candid .cph { display: block; width: 100%; border: 0; padding: 0; border-radius: 0; aspect-ratio: 4 / 3; background: var(--surface-2); cursor: zoom-in; }
.candid .cph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.candid .cadm { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px; flex-wrap: wrap; }
button.small { font-size: 12px; padding: 5px 10px; }
@media (max-width: 640px) { .candids { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
