/* Wanderings. Tokens come from design/tokens.css: a paper palette, a serif
   for headings and one accent. The design names Newsreader and Geist; they
   are listed first so self-hosted copies would be picked up, with system
   fonts as the fallback (the Content-Security-Policy allows no external
   fonts). Plain classes so the admin UI, which shares this file, keeps
   working. */

:root {
  --bg: #f7f3ea;
  --bg-2: #faf7ef;
  --surface: #ffffff;
  --sunk: #fbf8f1;
  --text: #1a1714;
  --text-2: #2c2722;
  --muted: #6a6358;
  --faint: #b5ad9c;
  --border: #e7e0cf;
  --border-strong: #d6cdb6;
  --accent: #c2410c;
  --accent-text: #ffffff;
  --accent-ink: #7a2a08;
  --accent-soft: #c2410c1a;
  --danger: #b42318;
  --notice: #fff4d6;
  --park: #c8d4b1;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(40, 30, 16, .06), 0 0 0 .5px rgba(40, 30, 16, .04);
  --shadow-2: 0 4px 14px rgba(40, 30, 16, .10), 0 0 0 .5px rgba(40, 30, 16, .05);
  --shadow-3: 0 16px 48px rgba(40, 30, 16, .16), 0 0 0 .5px rgba(40, 30, 16, .06);
  --serif: "Newsreader", Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17140f;
    --bg-2: #1c1813;
    --surface: #221e18;
    --sunk: #1d1a14;
    --text: #efe9dc;
    --text-2: #ddd5c4;
    --muted: #a39a89;
    --faint: #6e6657;
    --border: #342e24;
    --border-strong: #463e31;
    --accent: #ea7a45;
    --accent-text: #1a0f08;
    --accent-ink: #f3b08a;
    --accent-soft: #ea7a4524;
    --danger: #ff8a7a;
    --notice: #3a3017;
    --park: #4a5a36;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 28px 16px 40px; }
main.wide { max-width: none; padding: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: 2rem; margin: 0 0 16px; }
h2 { font-size: 1.3rem; margin: 0 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
code { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- header --- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.site-header nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-header nav a:not(.button), .site-header nav button.link {
  padding: 6px 10px; border-radius: 7px; color: var(--text-2); text-decoration: none; font-weight: 500;
}
.site-header nav a:not(.button):hover, .site-header nav button.link:hover { background: rgba(40, 30, 16, .06); color: var(--text); }
.site-header nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em;
  text-decoration: none; color: var(--text);
}
.brand svg { width: 22px; height: 22px; }
.site-footer { padding: 16px 24px; color: var(--muted); font-size: .85rem; text-align: center; }

/* --- surfaces --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; }
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 { font-size: 2.8rem; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 24px; font-size: 1.05rem; }

/* --- forms --- */
label { display: block; margin: 0 0 12px; font-weight: 500; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: baseline; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input[type=checkbox] { display: inline; width: auto; margin: 0; }
input[type=file] { padding: 7px; }
fieldset { border: 1px solid var(--border); border-radius: 9px; margin: 0 0 12px; padding: 12px; }
legend { font-weight: 600; padding: 0 6px; }
.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; font-weight: 400; }

button, .button {
  display: inline-block; padding: 8px 15px; font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer; text-decoration: none;
  color: var(--accent-text); background: var(--accent); border: 1px solid var(--accent); border-radius: 9px;
}
button:hover, .button:hover { filter: brightness(.94); color: var(--accent-text); }
button.secondary, .button.secondary { color: var(--text-2); background: transparent; border-color: var(--border-strong); }
button.secondary:hover, .button.secondary:hover { background: rgba(40, 30, 16, .05); color: var(--text); filter: none; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: inherit; }
button.link:hover { filter: none; color: var(--accent-ink); }
button.link.danger { color: var(--danger); }
button.small, .button.small { padding: 4px 10px; font-size: .82rem; border-radius: 7px; }
button[disabled] { opacity: .6; cursor: progress; }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.muted { color: var(--muted); font-weight: 400; }
.error { color: var(--danger); margin: -6px 0 12px; font-size: .9rem; }
.flash, .notice { background: var(--notice); border: 1px solid var(--border); border-radius: 9px; padding: 10px 14px; }
main.wide .flash { margin: 12px 24px 0; }
.badge { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.danger-zone { border-color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--sunk); border: 1px solid var(--border); color: var(--text-2); font-size: .78rem; font-weight: 500; white-space: nowrap;
}
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.chip button { all: unset; cursor: pointer; line-height: 1; padding: 0 0 0 2px; color: var(--muted); }
.chip button:hover { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eyebrow { font: 500 .72rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }

/* --- people --- */
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.people li:last-child { border-bottom: 0; }
.people.card { padding-top: 6px; padding-bottom: 6px; }
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { margin: 0; }
.pager { display: flex; justify-content: space-between; }
.stats { display: flex; gap: 32px; margin: 0; }
.stats dt { color: var(--muted); font-size: .85rem; }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 700; font-family: var(--serif); }

table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  td { border: 0; padding: 2px 0; }
}
app-copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qr-box { margin: 0 0 12px; }
.qr { display: block; width: 200px; height: 200px; image-rendering: pixelated; border-radius: 8px; }
code.codes { display: block; white-space: pre; font-size: 1rem; line-height: 1.6; }

/* Pictures */
.avatar { border-radius: 50%; object-fit: cover; background: var(--border); vertical-align: middle; }
.avatar.large { width: 72px; height: 72px; }

/* The account menu: a <details>, so it works without JavaScript */
.site-header .user-menu { position: relative; }
.site-header .user-menu summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--muted);
}
.site-header .user-menu summary::-webkit-details-marker { display: none; }
.site-header .user-menu summary:hover, .site-header .user-menu[open] summary { background: var(--border); color: var(--text); }
.site-header .user-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px;
  display: flex; flex-direction: column; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.site-header .user-menu .menu a, .site-header .user-menu .menu button.link {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text);
  text-decoration: none; font: inherit;
}
.site-header .user-menu .menu a:hover, .site-header .user-menu .menu button.link:hover { background: var(--border); }
.site-header .user-menu .menu form { margin: 0; }

/* --- home: a grid of lists --- */
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; list-style: none; margin: 0 0 28px; padding: 0; }
.list-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: inherit; height: 100%; transition: box-shadow .15s, transform .15s;
}
.list-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); color: inherit; }
.list-card .cover { height: 120px; }
.list-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.list-card h3 { margin: 0; font-size: 1.1rem; }
.list-card .meta { color: var(--muted); font-size: .82rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.list-card .desc { color: var(--text-2); font-size: .88rem; margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }

/* A generated cover for lists without a picture: a sky over hills, tinted by
   the list (cover-0 to cover-7). */
.cover {
  position: relative; overflow: hidden; background-size: cover; background-position: center;
  background-image: linear-gradient(180deg, var(--c1) 0%, var(--c2) 100%);
  --c1: #f6d7c2; --c2: #d9b48a; --hill: #c9a87e;
}
.cover::before {
  content: ""; position: absolute; right: 18%; top: 20%; width: 18%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #ffffffaa 0%, #ffffff00 70%); filter: blur(2px);
}
.cover::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -30%; height: 70%; border-radius: 50% 50% 0 0;
  background: var(--hill); opacity: .55;
}
.cover.has-image::before, .cover.has-image::after { display: none; }
.cover-1 { --c1: #dfe7f1; --c2: #9aa9c0; --hill: #5d6b86; }
.cover-2 { --c1: #e3d9c2; --c2: #b3a176; --hill: #7a8c63; }
.cover-3 { --c1: #f3d6c5; --c2: #d89a6a; --hill: #9c5a3a; }
.cover-4 { --c1: #efe5d0; --c2: #b89572; --hill: #5e4123; }
.cover-5 { --c1: #e7e4d4; --c2: #a7b394; --hill: #7d8a6b; }
.cover-6 { --c1: #dde2ea; --c2: #8d96a8; --hill: #3a3a4c; }
.cover-7 { --c1: #eee2c9; --c2: #d3a46e; --hill: #9a7755; }
@media (prefers-color-scheme: dark) { .cover { filter: brightness(.82) saturate(.9); } }

/* --- list page --- */
.list-hero { position: relative; padding: 28px 24px 22px; border-bottom: 1px solid var(--border); overflow: hidden; }
.list-hero .cover { position: absolute; inset: 0; opacity: .55; }
.list-hero .cover::before, .list-hero .cover::after { opacity: .6; }
.list-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, var(--bg) 100%); pointer-events: none; }
.list-hero > .inner { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.list-hero h1 { font-size: 2.6rem; margin: 0 0 8px; max-width: 18ch; text-wrap: balance; }
.list-hero .lede { color: var(--text-2); max-width: 60ch; margin: 0 0 12px; font-size: 1.02rem; }
.progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
progress { appearance: none; -webkit-appearance: none; width: 140px; height: 5px; border: 0; border-radius: 99px; background: var(--border); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--border); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.query-box { font-family: var(--mono); font-size: .82rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; display: inline-block; max-width: 100%; overflow-wrap: anywhere; }

wd-list { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: calc(100vh - 230px); min-height: 520px; }
.list-map { position: relative; min-width: 0; min-height: 360px; border-right: 1px solid var(--border); }
.list-panel { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); }
.panel-tools { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.sort-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.sort-links a { padding: 2px 8px; border-radius: 99px; color: var(--text-2); text-decoration: none; }
.sort-links a:hover { background: rgba(40, 30, 16, .06); }
.sort-links a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.panel-tools form.search { margin: 0; }
.place-rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.place-row { border-bottom: 1px solid var(--border); position: relative; }
.place-row.is-selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.place-row > button {
  all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start;
  width: 100%; padding: 12px 14px;
}
.place-row > button:hover { background: rgba(40, 30, 16, .04); }
.place-row > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.place-n {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; margin-top: 1px;
}
.place-row.visited .place-n { background: var(--text-2); }
.place-name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.place-sub { display: block; color: var(--muted); font-size: .75rem; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-sub .closed { color: var(--danger); font-weight: 600; }
.place-side { text-align: right; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.stars { color: var(--accent); letter-spacing: 1px; font-size: .82rem; }
.stars .off { color: var(--faint); }
.panel-empty { padding: 28px 18px; color: var(--muted); text-align: center; }
.panel-foot { padding: 8px 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); }

@media (max-width: 860px) {
  wd-list { grid-template-columns: 1fr; height: auto; }
  wd-map { height: 46vh; }
  .list-map { border-right: 0; border-bottom: 1px solid var(--border); }
  .place-rows { overflow: visible; }
  .list-hero h1 { font-size: 2rem; }
}

/* --- the map --- */
wd-map {
  display: block; position: relative; overflow: hidden; width: 100%; height: 100%; min-height: 320px; background: #d6e6e3;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
wd-map.is-dragging { cursor: grabbing; }
wd-map:focus-visible { outline-offset: -3px; }
.wd-map-tiles, .wd-map-pins { position: absolute; inset: 0; }
.wd-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; user-select: none; -webkit-user-drag: none; }
.wd-pin {
  all: unset; box-sizing: border-box; position: absolute; left: 0; top: 0; width: 26px; height: 34px; margin: -34px 0 0 -13px; cursor: pointer;
  display: flex; align-items: flex-start; justify-content: center; z-index: 1;
}
.wd-pin[hidden] { display: none; }
.wd-pin::before {
  content: ""; position: absolute; left: 1px; top: 0; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; background: var(--accent);
  transform: rotate(-45deg); box-shadow: 0 2px 5px rgba(0, 0, 0, .35); border: 2px solid #fff;
}
.wd-pin-n { position: relative; margin-top: 4px; color: #fff; font: 700 11px/16px var(--sans); }
.wd-pin:hover::before { filter: brightness(.9); }
.wd-pin:focus-visible::before { outline: 2px solid var(--text); outline-offset: 2px; }
.wd-pin.is-selected { z-index: 3; }
.wd-pin.is-selected::before { background: var(--text); width: 30px; height: 30px; left: -1px; top: -4px; }
.wd-pin.is-selected .wd-pin-n { margin-top: 3px; }
.wd-map-controls { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.wd-map-button {
  all: unset; box-sizing: border-box; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer;
  box-shadow: var(--shadow-1); font-size: 1.1rem; line-height: 1;
}
.wd-map-button:hover { background: var(--sunk); }
.wd-map-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wd-map-button[disabled] { opacity: .45; cursor: default; }
.wd-map-attribution {
  position: absolute; right: 0; bottom: 0; z-index: 5; padding: 2px 8px; font-size: 11px; color: #333; background: rgba(255, 255, 255, .8);
  border-top-left-radius: 6px;
}
.wd-map-fallback { padding: 24px; color: var(--muted); }

/* --- the place drawer --- */
wd-place-drawer { display: none; }
wd-place-drawer.open { display: block; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 17, 12, .32); z-index: 70; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3); z-index: 71; display: flex; flex-direction: column; overflow: hidden;
}
.drawer-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--border); position: relative; }
.drawer-head h2 { margin: 0 36px 4px 0; font-size: 1.55rem; }
.drawer-close { position: absolute; right: 12px; top: 12px; }
.drawer-body { overflow-y: auto; padding: 16px 20px 28px; display: grid; gap: 18px; align-content: start; flex: 1; }
.drawer section h3 { font: 600 .72rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .quiet { color: var(--muted); font-size: .82rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.been { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--sunk); border: 1px solid var(--border); color: var(--muted); font-weight: 500; cursor: pointer; }
.been::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.been.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.been.on::before { background: var(--accent); }
.been:hover { filter: none; background: var(--accent-soft); color: var(--accent-ink); }
.rate { display: inline-flex; gap: 2px; }
.rate button { all: unset; cursor: pointer; font-size: 1.35rem; line-height: 1; color: var(--faint); padding: 1px 2px; border-radius: 4px; }
.rate button.on { color: var(--accent); }
.rate button:hover { color: var(--accent); }
.rate button:focus-visible { outline: 2px solid var(--accent); }
.tag-form { display: flex; gap: 6px; margin-top: 8px; }
.tag-form input { margin: 0; }
.notes { display: grid; gap: 10px; }
.note { background: var(--sunk); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.note p { margin: 0 0 6px; overflow-wrap: anywhere; }
.note-body { overflow-wrap: anywhere; }
.note-body p { margin: 0 0 6px; }
.note-body ul, .note-body ol { margin: 0 0 6px; padding-left: 1.3em; }
.note-body blockquote { margin: 0 0 6px; padding-left: 10px; border-left: 3px solid var(--border); color: var(--muted); }
.note img { display: block; max-width: 100%; border-radius: 8px; margin-top: 6px; }
.note .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .76rem; }
.note-form { display: grid; gap: 8px; }
.note-form textarea { margin: 0; min-height: 70px; }
.drawer .status { color: var(--muted); font-size: .85rem; min-height: 1.2em; }
.drawer .status.bad { color: var(--danger); }

/* --- place search --- */
wd-place-search { display: block; position: relative; }
wd-place-search .results { margin-top: 8px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
wd-place-search .results:empty { display: none; }
wd-place-search h4 { margin: 0; padding: 8px 12px 4px; font: 600 .68rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
wd-place-search .hit { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--border); }
wd-place-search .hit .t { min-width: 0; }
wd-place-search .hit b { display: block; font-family: var(--serif); font-size: 1rem; }
wd-place-search .hit small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
wd-place-search .msg { padding: 10px 12px; color: var(--muted); font-size: .85rem; }
wd-place-search .msg.bad { color: var(--danger); }

.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.preview { height: 140px; border-radius: var(--radius); margin-bottom: 12px; }
wd-query-check .query-result.ok { color: var(--accent-ink); }
wd-query-check .query-result.bad { color: var(--danger); }
wd-query-check textarea { font-family: var(--mono); font-size: .88rem; }

/* Sharing panel and the place page. */
input.copy { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
#sharing h3 { margin: 18px 0 4px; font-size: 1rem; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.place-head { align-items: flex-start; }
.place-map { height: 280px; border-radius: var(--radius, 10px); overflow: hidden; margin-bottom: 16px; }
.place-map wd-map { display: block; height: 100%; }

/* The "Add to list" picker. */
dialog.picker { width: min(520px, calc(100vw - 32px)); max-height: min(80vh, 640px); border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface, #fff); color: inherit; }
dialog.picker::backdrop { background: rgb(0 0 0 / .4); }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.picker-head h2 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.picker-status { margin: 8px 18px 0; min-height: 1.3em; font-size: .9rem; }
.picker-status.bad { color: var(--danger, #b3261e); }
.picker-body { padding: 4px 18px 18px; overflow-y: auto; max-height: 60vh; }
.picker-body h3 { margin: 14px 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.picker-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.picker-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title extra" "meta extra"; gap: 0 12px; width: 100%; text-align: left; background: var(--surface, #fff); color: inherit; border: 1px solid var(--border); padding: 10px 12px; }
.picker-row:hover:not(:disabled) { border-color: var(--accent); }
.picker-row:disabled { opacity: .6; cursor: default; }
.picker-row.done { border-color: var(--accent); }
.picker-title { grid-area: title; font-weight: 600; overflow-wrap: anywhere; }
.picker-meta { grid-area: meta; font-size: .8rem; color: var(--muted); }
.picker-extra { grid-area: extra; align-self: center; font-size: .8rem; color: var(--accent); }
.picker-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.picker-tools input { flex: 1; min-width: 0; }

/* Home tabs, collaborators, votes. */
nav.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 18px; }
nav.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav.tabs a[aria-current="page"] { color: var(--ink, inherit); border-bottom-color: var(--accent); font-weight: 600; }
.collabs { margin: 6px 0 0; font-size: .9rem; }
ul.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.activity li { padding: 10px 14px; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; }
ul.activity time { margin-left: 8px; font-size: .85rem; }

/* The Share page. */
.vis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.vis-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface, #fff); color: inherit; }
.vis-card .vis-title { font-weight: 600; }
.vis-card .vis-desc { font-size: .8rem; color: var(--muted); line-height: 1.4; font-weight: 400; }
.vis-card.on { border-color: var(--accent); background: var(--accent-soft, rgb(0 0 0 / .03)); }
form.invite { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 12px 0; }
ul.collab-list { list-style: none; margin: 8px 0 0; padding: 0; }
.collab-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.collab-row .who { flex: 1; min-width: 160px; }
.collab-row .role-fixed { font-size: .85rem; color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft, #eee); color: var(--accent); font-weight: 600; }

/* Guides: long-form writing about a list. */
.mono { font-family: var(--mono); }
.guide-hero { position: relative; padding: 56px 24px 40px; border-bottom: 1px solid var(--border); overflow: hidden; }
.guide-hero .cover { position: absolute; inset: 0; opacity: .55; }
.guide-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 10%, var(--bg) 100%); pointer-events: none; }
.guide-hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.guide-hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -.025em; line-height: 1.04; margin: 8px 0; max-width: 18ch; text-wrap: balance; }
.guide-hero .lede { font-size: 1.2rem; color: var(--text-2); max-width: 40ch; margin: 0 0 16px; line-height: 1.4; }
.guide-byline { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
.guide-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.guide-body { display: grid; grid-template-columns: 240px minmax(0, 640px); gap: 48px; max-width: 1180px; margin: 40px auto 0; padding: 0 32px 80px; }
.guide-toc { position: sticky; top: 16px; align-self: start; font-size: .88rem; }
.guide-toc ol { list-style: none; margin: 0 0 18px; padding: 0; }
.guide-toc li a { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; color: var(--muted); text-decoration: none; line-height: 1.35; }
.guide-toc li a:hover { color: var(--text); }
.guide-toc li .mono { color: var(--faint); font-size: .72rem; }
.guide-map { display: block; position: relative; height: 200px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 0 0 10px; }
a.button.block { display: block; text-align: center; }
.g-prose { font-family: var(--serif); font-size: 1.22rem; line-height: 1.65; margin: 0 0 22px; text-wrap: pretty; }
.g-prose p { margin: 0 0 1em; }
.g-prose p:last-child { margin-bottom: 0; }
.g-prose ul, .g-prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.g-prose blockquote { margin: 0 0 1em; padding-left: 1em; border-left: 3px solid var(--border); color: var(--text-2); font-style: italic; }
.g-prose a, .g-place-text a { color: var(--accent); }
.g-prose code, .g-place-text code, .note-body code { font-family: var(--mono, monospace); font-size: .88em; background: var(--sunk); padding: 0 .3em; border-radius: 4px; }
/* Indentation: a section nested under the one before it. */
.ind-1 { margin-left: 28px; }
.ind-2 { margin-left: 56px; }
.g-heading.g-sub { font-size: 1.4rem; margin-top: 32px; }
h4.g-heading.g-sub { font-size: 1.15rem; }
.guide-toc li.toc-1 a { padding-left: 14px; }
.guide-toc li.toc-2 a { padding-left: 28px; }
.g-place-text { margin-top: 8px; font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.g-place-text p { margin: 0 0 .6em; }
.g-place-text p:last-child { margin-bottom: 0; }
.g-place-text ul, .g-place-text ol { margin: 0 0 .6em; padding-left: 1.3em; }
.g-figure { margin: 26px 0; }
.g-figure img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); }
.g-figure figcaption { margin-top: 8px; color: var(--muted); font-size: .85rem; }
.g-map { display: block; height: 340px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.g-instagram { display: grid; gap: 8px; justify-items: start; padding: 16px; background: var(--sunk); border: 1px solid var(--border); border-radius: var(--radius); }
.g-instagram iframe { width: 100%; max-width: 540px; min-height: 620px; border: 0; background: #fff; border-radius: var(--radius); }
h2 .more { font-family: var(--sans, inherit); font-size: .8rem; font-weight: 400; margin-left: 10px; }
.g-prose:first-child p:first-child::first-letter { float: left; font-size: 3.5rem; line-height: .85; margin: 6px 8px 0 0; font-weight: 600; font-style: italic; color: var(--accent); }
.g-heading { display: flex; align-items: baseline; gap: 14px; font-family: var(--serif); font-weight: 500; font-size: 1.9rem; letter-spacing: -.015em; line-height: 1.15; margin: 48px 0 14px; scroll-margin-top: 16px; }
.g-num { align-self: start; margin-top: 8px; font-size: .85rem; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 4px; }
.g-pull { margin: 30px 0; padding: 26px 0; border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1.35; color: var(--text-2); letter-spacing: -.01em; }
.g-place { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin: 14px 0; background: var(--sunk); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.g-place.is-selected { background: var(--accent-soft); }
.g-pin { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: .82rem; font-variant-numeric: tabular-nums; }
.g-place-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.g-place-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; letter-spacing: -.01em; }
.g-place-sub { color: var(--muted); font-size: .78rem; }
.g-place-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.g-end { margin-top: 56px; padding: 36px 0 0; text-align: center; border-top: 1px solid var(--border); }
.g-end-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; margin: 0 0 6px; }
@media (max-width: 1000px) {
  .guide-body { grid-template-columns: minmax(0, 1fr); padding: 0 20px 60px; gap: 24px; }
  .guide-toc { position: static; }
  .guide-toc nav { display: none; }
  .guide-map { height: 220px; }
}

/* The guide editor. */
wd-guide-editor { display: grid; gap: 14px; max-width: 760px; padding: 0 24px 80px; }
.ge-field { display: grid; gap: 4px; }
.ge-field > span { font-weight: 600; font-size: .9rem; }
.ge-field .ge-title { font-family: var(--serif); font-size: 1.5rem; }
.ge-blocks { display: grid; gap: 12px; }
.ge-block { display: grid; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.ge-block-head { display: flex; justify-content: space-between; align-items: center; }
.ge-block-head .eyebrow { margin: 0; }
.ge-block-tools { display: flex; gap: 4px; }
.ge-block-tools button { padding: 2px 9px; min-width: 0; }
.ge-block textarea, .ge-block input, .ge-block select { width: 100%; font: inherit; }
.ge-block.ge-prose textarea { font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; }
.ge-block.ge-heading input { font-family: var(--serif); font-size: 1.3rem; }
.ge-block.ge-pull input { font-family: var(--serif); font-style: italic; font-size: 1.1rem; }
.ge-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ge-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
.ge-status { margin: 0 0 0 4px; font-size: .88rem; color: var(--muted); }
.ge-status.ok { color: var(--accent-ink); }
.ge-status.error { color: var(--danger); }
.ge-empty { padding: 18px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

.guide-grid { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.guide-card { display: grid; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); color: inherit; text-decoration: none; box-shadow: var(--shadow-1); }
.guide-card:hover { box-shadow: var(--shadow-2); }
.guide-card .eyebrow { margin: 0; }
.guide-card-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.guide-card-sub { color: var(--muted); font-size: .9rem; }

/* The importer. */
wd-import { display: block; max-width: 920px; }
.imp { display: grid; gap: 14px; }
.imp-card { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: grid; gap: 8px; }
.imp-card p { margin: 0; }
.imp-row { display: flex; gap: 8px; }
.imp-row input { flex: 1; }
.imp-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.imp-field { display: grid; gap: 4px; }
.imp-field > span { font-weight: 600; font-size: .9rem; }
.imp-progress { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.imp-progress progress { width: 220px; }
.imp-summary { margin: 0; color: var(--muted); font-size: .9rem; }
.imp-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: 60vh; overflow-y: auto; }
.imp-row-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.imp-row-item:last-child { border-bottom: 0; }
.imp-entry { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.imp-match { display: flex; gap: 8px; align-items: center; min-width: 0; }
.imp-match select { flex: 1; min-width: 0; font: inherit; }
.imp-ok { color: var(--accent-ink); font-weight: 600; font-size: .85rem; }
.imp-maybe { color: #8a5a00; font-weight: 600; font-size: .85rem; }
.imp-bad { color: var(--danger); font-size: .9rem; }
.imp-error { margin: 0; color: var(--danger); }
.imp-actions { display: flex; gap: 8px; }
.imp-help { margin-top: 24px; color: var(--text-2); }
.imp-help summary { cursor: pointer; font-weight: 600; }
@media (max-width: 640px) { .imp-row-item { grid-template-columns: minmax(0, 1fr); } }

/* Links on a place */
ul.links { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
ul.links li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; overflow-wrap: anywhere; }
ul.links strong { font: 600 .72rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
form.link-form { display: grid; grid-template-columns: minmax(120px, 160px) 1fr 1fr auto; gap: 10px; align-items: end; }
form.link-form label { margin: 0; }
@media (max-width: 720px) { form.link-form { grid-template-columns: 1fr; } }

ul.chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.chips li { padding: 3px 10px; border-radius: 99px; background: var(--sunk); border: 1px solid var(--border); font-size: .82rem; color: var(--text-2); }

/* Guide editor: indentation, pictures, maps and previews. */
.ge-block.is-indented-1 { margin-left: 24px; }
.ge-block.is-indented-2 { margin-left: 48px; }
.ge-options { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .85rem; }
.ge-options label { display: inline-flex; gap: 6px; align-items: center; }
.ge-options select, .ge-options input[type="text"], .ge-options input[type="url"] { width: auto; }
.ge-preview { padding: 10px 12px; background: var(--sunk); border: 1px dashed var(--border); border-radius: var(--radius); font-size: .95rem; }
.ge-preview p { margin: 0 0 .6em; }
.ge-preview p:last-child { margin-bottom: 0; }
.ge-thumb { max-width: 220px; max-height: 160px; border-radius: 8px; }
.ge-hint { color: var(--muted); font-size: .78rem; }
