:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1f2a2e;
  --muted: #66727a;
  --line: #e4ddd2;
  --accent: #1f5f5b;
  --accent-soft: #d8ebe8;
  --warm: #b5532a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --serif: "Lora", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191b; --surface: #1c2326; --ink: #e8e4dc; --muted: #9aa5ab;
    --line: #2d373b; --accent: #6fbdb5; --accent-soft: #1f3a38; --warm: #e08a5f;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: .2em 0 .6em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }
.muted { color: var(--muted); font-weight: 400; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* ---------- header / nav ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 1.15rem var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font: 600 .85rem var(--sans); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
.nav-top { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-item > a { display: block; padding: 18px 12px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav-item.active > a { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.dropdown { display: none; position: absolute; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; min-width: 220px; max-height: 75vh; overflow: auto; }
.dropdown ul { list-style: none; margin: 0; padding: 0; }
.dropdown a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.dropdown a:hover, .dropdown a[aria-current] { background: var(--accent-soft); }
.dropdown .sub { padding-left: 12px; margin-bottom: 6px; }
.dropdown .sub a { color: var(--muted); }
.dropdown-grid > ul { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); width: 440px; }
.nav-item.has-children:hover > .dropdown, .nav-item.has-children:focus-within > .dropdown { display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); max-height: 80vh; overflow: auto; }
  .site-nav.open { display: block; }
  .nav-top { flex-direction: column; padding: 8px 16px 16px; }
  .nav-item > a { padding: 10px 0; }
  .nav-item.active > a { box-shadow: none; }
  .dropdown, .nav-item.has-children:hover > .dropdown { display: none; position: static; box-shadow: none; border: 0; padding: 0 0 8px 8px; max-height: none; }
  .nav-item.expanded > .dropdown { display: block; }
  .dropdown-grid > ul { width: auto; grid-template-columns: repeat(4, 1fr); }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; padding: 20px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.footer-inner a { color: var(--muted); }

/* ---------- home ---------- */
.hero h1 { max-width: 760px; font-weight: 500; }
.hero-img { margin: 0 0 32px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile h2 { margin: 0 0 4px; font-size: 1.2rem; color: var(--accent); }
.tile p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- buttons / chips ---------- */
.btn { display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--accent); color: var(--accent); text-decoration: none; font-weight: 500; font-size: .92rem; white-space: nowrap; }
.btn:hover { background: var(--accent); color: #fff; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.member-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; background: var(--surface); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- travels ---------- */
.travel-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.member-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.member-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 6px; }
.member-card h2 { margin: 0; font-size: 1.25rem; }
.member-card a { color: var(--ink); text-decoration: none; }
.member-card a:hover { color: var(--accent); }
.member-card strong { font-size: 1.3rem; color: var(--accent); }
.bar { height: 6px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

.table-wrap { overflow: auto; max-height: 78vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.travel-table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.travel-table th, .travel-table td { padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.travel-table tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.travel-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; box-shadow: inset 0 -2px 0 var(--line); }
.travel-table thead th:first-child { text-align: left; }
.travel-table thead a { color: var(--ink); text-decoration: none; font-weight: 600; }
.travel-table .count { display: block; font-size: .78rem; color: var(--accent); font-weight: 600; }
.travel-table tbody tr:hover { background: var(--accent-soft); }
.tick { color: var(--accent); font-weight: 700; }

.travel-map { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 280px; padding: 8px; }
.travel-map svg { width: 100%; height: auto; display: block; }
.travel-map path.land { stroke: var(--surface); stroke-width: .6; }
.travel-map path.land:hover, .travel-map circle.dot:hover { opacity: .8; }
.map-tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); padding: 4px 8px; border-radius: 6px; font-size: .82rem; z-index: 50; max-width: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .85rem; color: var(--muted); margin: 8px 0 20px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.place-list { columns: 3 170px; padding-left: 18px; }
.my-maps { margin-top: 24px; }
.my-maps summary { cursor: pointer; color: var(--accent); }
.my-maps iframe { width: 100%; height: 480px; border: 0; border-radius: var(--radius); margin-top: 10px; }

/* ---------- galleries ---------- */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.year-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.year-card img, .year-card .ph { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.year-card .ph { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 600 1.6rem var(--serif); }
.year-card span { padding: 8px 10px; font-weight: 600; }
.year-card:hover { border-color: var(--accent); }
.year-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 18px; }
.year-nav h2 { margin: 0; font-size: 1.6rem; }
.year-nav .btn[rel=next] { justify-self: end; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.gallery.letters { grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; }
.gallery a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.empty { color: var(--muted); }
.embed iframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.embed-link { font-size: .88rem; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; z-index: 100; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 90vh; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; padding: 12px 18px; }
.lb-close { top: 4px; right: 8px; }
.lb-prev { left: 4px; } .lb-next { right: 4px; }

/* ---------- travel editor (/admin) ---------- */
.flash { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent-soft); }
.flash.error { border-color: var(--warm); background: transparent; color: var(--warm); }
.admin-narrow { max-width: 560px; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px; }
.admin-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.admin-card label { display: block; font-weight: 500; margin-bottom: 4px; }
.admin-card input[type=password], .admin-card input[type=search], .admin-card input:not([type]) {
  width: 100%; max-width: 360px; padding: 8px 10px; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.btn { background: none; font-family: inherit; cursor: pointer; line-height: 1.5; }
.btn:disabled { opacity: .45; cursor: default; background: none; color: var(--accent); }
.btn-solid { background: var(--accent); color: #fff; }
.admin-person { color: var(--ink); text-decoration: none; }
.admin-person:hover { border-color: var(--accent); }
.admin-person .btn { justify-self: start; margin-top: 4px; }
.admin-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
fieldset.admin-card { min-width: 0; }
fieldset.admin-card legend { font: 600 1.15rem var(--serif); padding: 0 6px; }
.pill { display: inline-block; min-width: 2em; text-align: center; padding: 0 8px; border-radius: 999px; background: var(--accent); color: #fff; font: 600 .85rem var(--sans); vertical-align: 2px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
.check-grid .check[hidden] { display: none; }
.admin-card label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.check:hover { background: var(--accent-soft); }
.check:has(input:checked) { font-weight: 600; color: var(--accent); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-bottom: 8px; }
.check-tools input[type=search] { margin: 0; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
