/* Points — shared design system for all three variants. */
:root {
  --bg: #f5f1ea;
  --surface: #fffdf9;
  --surface-2: #efe9df;
  --ink: #1f1c18;
  --ink-2: #5d564d;
  --ink-3: #8c8378;
  --line: #e1d9cc;
  --accent: #a64b24;
  --accent-ink: #fff;
  --accent-soft: #f3e1d6;
  --visited: #2e7a4c;
  --visited-soft: #dcefe2;
  --want: #b77d0c;
  --want-soft: #f6ebd0;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgb(40 30 20 / .06), 0 6px 24px rgb(40 30 20 / .10);
  --shadow-lg: 0 10px 40px rgb(40 30 20 / .22);
  --radius: 14px;
  --radius-sm: 9px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "PT Serif", Georgia, serif;
  --header-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151310; --surface: #1f1c18; --surface-2: #2a2621; --ink: #f1ebe2; --ink-2: #c3b9ac; --ink-3: #8f8679;
    --line: #38332c; --accent: #e07a4a; --accent-ink: #1a0f08; --accent-soft: #3d2619;
    --visited: #58b97f; --visited-soft: #1d3527; --want: #e0aa3e; --want-soft: #3a2f16; --danger: #f2827a;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 24px rgb(0 0 0 / .35); --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151310; --surface: #1f1c18; --surface-2: #2a2621; --ink: #f1ebe2; --ink-2: #c3b9ac; --ink-3: #8f8679;
  --line: #38332c; --accent: #e07a4a; --accent-ink: #1a0f08; --accent-soft: #3d2619;
  --visited: #58b97f; --visited-soft: #1d3527; --want: #e0aa3e; --want-soft: #3a2f16; --danger: #f2827a;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 24px rgb(0 0 0 / .35); --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(26px, 5vw, 38px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; fill: var(--accent-ink); }
.brand small { font-family: var(--font); font-weight: 500; font-size: 12px; color: var(--ink-3); }
.variants { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 11px; margin-left: auto; }
.variants a { padding: 5px 11px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.variants a:hover { text-decoration: none; color: var(--ink); }
.variants a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink); flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700;
  display: grid; place-items: center; font-size: 14px; border: none; cursor: pointer; }
@media (max-width: 560px) {
  .brand small { display: none; }
  .variants a { padding: 5px 8px; font-size: 13px; }
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar .theme-btn { display: none; }
}

/* ---------- buttons, chips, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-visited { background: var(--visited); border-color: var(--visited); color: #fff; }
.btn-visited:hover { background: color-mix(in srgb, var(--visited) 88%, black); }
.btn-want-on { background: var(--want-soft); border-color: var(--want); color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-kind[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.chip-kind[aria-pressed="false"] { color: var(--ink-3); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.chip-kind[aria-pressed="false"] .dot { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip .count { color: inherit; opacity: .6; font-size: 12px; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
textarea.input { min-height: 80px; resize: vertical; }
.search {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.search svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.search input { border: none; outline: none; background: transparent; flex: 1; min-width: 0; height: 100%; }
.search input::-webkit-search-cancel-button { display: none; }

/* ---------- monument card (shared by sheet, modal, detail page) ---------- */
.kind-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kind-badge .dot { width: 9px; height: 9px; border-radius: 50%; }
.status-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.status-pill.visited { background: var(--visited-soft); color: var(--visited); }
.status-pill.want { background: var(--want-soft); color: var(--want); }
.status-pill.pending { background: var(--surface-2); color: var(--ink-2); }
.status-pill svg { width: 13px; height: 13px; }
.card-photo { position: relative; aspect-ratio: 4/3; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .credit {
  position: absolute; right: 0; bottom: 0; max-width: 100%; padding: 3px 8px; font-size: 11px; color: #fff;
  background: rgb(0 0 0 / .55); border-top-left-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-photo .credit a { color: #fff; text-decoration: underline; }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-3); gap: 6px; text-align: center; font-size: 13px; }
.placeholder svg { width: 42px; height: 42px; opacity: .55; }
.gallery { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); scrollbar-width: thin; }
.gallery > * { flex: none; width: 100%; scroll-snap-align: start; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 12px 0; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.inscription { font-family: var(--serif); font-style: italic; background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 10px 10px 0; white-space: pre-line; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checkin-panel { background: var(--visited-soft); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; }
.checkin-panel .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.verified { color: var(--visited); font-weight: 600; font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.verified svg { width: 15px; height: 15px; }
.linkrow { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; margin-top: 14px; }
.linkrow button { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; }

/* ---------- sheet / modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgb(15 10 5 / .45); z-index: 60; animation: fade .15s; }
.modal {
  position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 20px; animation: pop .18s ease-out;
}
.modal-head { display: flex; align-items: start; gap: 10px; margin-bottom: 12px; }
.modal-head h2 { flex: 1; margin: 0; }
@media (max-width: 640px) {
  .modal { top: auto; bottom: 0; left: 0; transform: none; width: 100%; border-radius: 18px 18px 0 0; max-height: 92dvh; animation: up .22s ease-out; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -47%) } }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
.toast-wrap { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; animation: up .2s; pointer-events: auto; display: flex; gap: 10px; align-items: center; }
.toast button { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; }
.toast.plus { background: var(--visited); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { background: none; border: none; padding: 8px 12px; cursor: pointer; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.error { color: var(--danger); font-size: 14px; min-height: 1em; }
.notice { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.dup-list { margin: 0; padding-left: 18px; font-size: 14px; }

/* ---------- map ---------- */
.maplibregl-map { font: 13px/1.4 var(--font); }
.maplibregl-ctrl-group { background: var(--surface) !important; border-radius: 10px !important; box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
:root[data-theme="dark"] .maplibregl-ctrl-icon, .dark-map .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--ink-2); }
.maplibregl-ctrl-attrib a { color: var(--ink-2) !important; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -44px 0 0 -22px; pointer-events: none; z-index: 5; }
.crosshair svg { width: 44px; height: 44px; filter: drop-shadow(0 3px 4px rgb(0 0 0 / .35)); }

/* ---------- landing ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hero { padding: 48px 0 28px; display: grid; gap: 14px; }
.hero p { font-size: 18px; color: var(--ink-2); max-width: 640px; }
.variant-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; padding-bottom: 32px; }
.variant-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: var(--ink); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.variant-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.variant-card .art { aspect-ratio: 16/10; background: var(--surface-2); display: grid; place-items: center; }
.variant-card .art svg { width: 70%; height: 80%; }
.variant-card .body { padding: 14px 16px 18px; }
.variant-card .body p { color: var(--ink-2); margin: 0; font-size: 14px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.stats-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat b { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--ink-2); }
footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 18px 0 28px; font-size: 13px; color: var(--ink-3); }
footer.site a { color: var(--ink-2); }
.prose { max-width: 720px; padding: 28px 0; }
.prose li { margin-bottom: 6px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td, .table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--visited); border-radius: inherit; }
