/* Camp Wild — "field guide / topographic" identity.
 * Signature: coordinates-as-identity (mono lat/lng, live map-center waypoint,
 * a rubber-stamp "verified" mark) over a faint contour texture on the chrome.
 */

/* ---- Fonts (self-hosted) ---- */
@font-face { font-family:"Space Grotesk"; font-weight:400; font-display:optional; src:url("../vendor/fonts/SpaceGrotesk-400.woff2") format("woff2"); }
@font-face { font-family:"Space Grotesk"; font-weight:500; font-display:optional; src:url("../vendor/fonts/SpaceGrotesk-500.woff2") format("woff2"); }
@font-face { font-family:"Space Grotesk"; font-weight:700; font-display:optional; src:url("../vendor/fonts/SpaceGrotesk-700.woff2") format("woff2"); }
@font-face { font-family:"Space Mono"; font-weight:400; font-display:optional; src:url("../vendor/fonts/SpaceMono-400.woff2") format("woff2"); }
@font-face { font-family:"Space Mono"; font-weight:700; font-display:optional; src:url("../vendor/fonts/SpaceMono-700.woff2") format("woff2"); }

:root {
  --paper:   #E9ECE4;   /* cool topographic paper */
  --card:    #F4F6F0;   /* raised surface */
  --ink:     #14241C;   /* deep spruce, near-black */
  --pine:    #1F5C3F;   /* primary green */
  --pine-d:  #16482F;
  --ochre:   #C2762A;   /* waypoint accent (the signature colour) */
  --water:   #2F6E8E;   /* topographic water blue */
  --line:    #C9D0C2;   /* contour / hairline */
  --muted:   #5C685A;   /* greenish grey text */
  --danger:  #9F3B2E;
  --sans: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 10px 30px rgba(20,36,28,0.12);
  --header-h: 56px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("../img/contours.svg");
  background-size: 480px 480px;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pine); }

/* ---- Header ---- */
.cw-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; gap: 16px;
  background: var(--ink); color: #EEF1EC;
  border-bottom: 2px solid var(--ochre);
  z-index: 1200; flex: 0 0 auto;
}
.cw-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: #fff; }
.cw-brand img { display: none; }            /* drop the old blob logo */
.cw-brand::before {                          /* typographic waypoint mark */
  content: "◆"; color: var(--ochre); font-size: 13px; transform: translateY(1px);
}
.cw-brand span {
  font-family: var(--mono); font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; font-size: 15px;
}
.cw-nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.cw-user { color: #9FB3A4; font-family: var(--mono); font-size: 12px; }

/* Live map-center waypoint readout — the signature element. */
.cw-waypoint {
  font-family: var(--mono); font-size: 12px; color: var(--ochre);
  letter-spacing: 0.02em; white-space: nowrap;
}
.cw-waypoint:empty { display: none; }
@media (max-width: 640px) { .cw-waypoint { display: none; } }

.cw-main { flex: 1 1 auto; min-height: 0; position: relative; }

/* ---- Header menu ---- */
.cw-menu { position: relative; }
#cw-menu-btn {
  background: transparent; color: #EEF1EC; border: 1px solid rgba(255,255,255,0.28);
  border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
#cw-menu-btn:hover { border-color: var(--ochre); }
.cw-menu-dd {
  position: absolute; right: 0; top: 130%; z-index: 1500; min-width: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.cw-menu-dd[hidden] { display: none; }
.cw-menu-dd button, .cw-menu-dd a {
  text-align: left; background: transparent; border: 0; border-radius: 6px;
  padding: 9px 11px; font: inherit; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer;
}
.cw-menu-dd button:hover, .cw-menu-dd a:hover { background: rgba(31,92,63,0.08); color: var(--pine); }
.cw-menu-group { display: flex; flex-direction: column; padding: 4px 0; border-top: 1px solid var(--line); }
.cw-menu-group:first-child { border-top: 0; }
.cw-menu-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 6px 11px 2px; }
.cw-menu-emph { font-weight: 700; color: var(--pine) !important; }
.cw-menu-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-menu-count { font-family: var(--mono); font-size: 11px; font-weight: 700; color: #1c1205; background: var(--ochre); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

/* Other-projects cards */
.cw-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.cw-project { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.cw-project-thumb { display: block; line-height: 0; background: var(--paper); }
.cw-project-thumb img { width: 100%; height: 130px; object-fit: cover; display: block; }
.cw-project-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cw-project-body h3 { margin: 0; font-size: 16px; }
.cw-project-body p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); flex: 1; }
.cw-project-link { font-family: var(--mono); font-size: 12px; color: var(--water); text-decoration: none; font-weight: 700; }

/* Object types description */
.cw-objtype { margin-top: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.cw-objtype:last-child { border-bottom: 0; }
.cw-objtype h3 { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--ink); border: 0; margin: 0 0 8px; }
.cw-objtype h3 img { width: 30px; height: 30px; }
.cw-objtype p { line-height: 1.55; margin: 0 0 8px; }
.cw-objtype-note { font-weight: 700; margin-bottom: 2px !important; }
.cw-objtype ul { margin: 0 0 8px; padding-left: 20px; line-height: 1.5; }
.cw-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.cw-examples img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; display: block; cursor: zoom-in; transition: transform .2s ease; }
.cw-examples img:hover { transform: scale(1.03); }

/* Team */
.cw-team { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
.cw-member { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.cw-member:last-child { border-bottom: 0; }
.cw-member-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 2px solid var(--line); background: var(--paper); }
.cw-member-body h3 { margin: 0 0 2px; font-size: 18px; }
.cw-member-role { margin: 0 0 6px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ochre); }
.cw-member-body p { margin: 0 0 8px; line-height: 1.55; }
.cw-member-link { font-family: var(--mono); font-size: 12px; color: var(--water); text-decoration: none; font-weight: 700; }

/* Legal pages (privacy / terms) */
.cw-legal h2 { font-size: 24px; }
.cw-legal h3 { font-family: var(--sans); font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--ink); border: 0; margin-top: 22px; }
.cw-legal h4 { font-size: 15px; margin: 18px 0 4px; }
.cw-legal h5 { font-size: 14px; color: var(--muted); margin: 14px 0 4px; }
.cw-legal p { line-height: 1.6; }
.cw-legal ol, .cw-legal ul { line-height: 1.55; }
.cw-legal table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
.cw-legal th, .cw-legal td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.cw-legal a { color: var(--water); }

/* ---- Map + controls ---- */
.cw-map { width: 100%; height: 100%; }
.leaflet-container { background: #dfe4da; font-family: var(--sans); }
.cw-locate {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; font-size: 17px; background: var(--card); color: var(--ink); text-decoration: none;
}
.cw-tools { position: absolute; top: 14px; right: 14px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; }
.cw-tool {
  position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; box-shadow: var(--shadow);
}
.cw-tool:hover { border-color: var(--ochre); color: var(--pine); }
.cw-tool-add { background: var(--pine); color: #fff; border-color: var(--pine-d); }
.cw-tool-add:hover { background: var(--ochre); border-color: var(--ochre); color: #fff; }
.cw-tool-add.active { background: var(--ochre); border-color: var(--ochre); }
.cw-tool-count {
  position: absolute; bottom: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ochre); color: #1c1205; font-family: var(--mono); font-size: 10px; font-weight: 700;
  border-radius: 9px;
}
.cw-tool-count:empty { display: none; }

/* Add-place chooser (pin / coordinates / current location) */
.cw-add { position: relative; }
.cw-add-menu {
  position: absolute; top: 0; right: 50px; width: 234px; z-index: 1200;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.cw-add-menu[hidden] { display: none; }
.cw-add-menu-label { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 6px 8px 8px; }
.cw-add-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink);
  padding: 9px 8px; border-radius: 7px; cursor: pointer;
}
.cw-add-menu button:hover { background: rgba(31,92,63,0.08); color: var(--pine); }
.cw-add-menu button svg { flex: 0 0 auto; color: var(--pine); }
.cw-add-menu button.is-loading { opacity: 0.6; pointer-events: none; }
.cw-add-hint {
  position: fixed; top: calc(var(--header-h) + 16px); left: 50%; transform: translateX(-50%); z-index: 1100;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: #EEF1EC; padding: 7px 8px 7px 15px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow);
}
.cw-add-hint[hidden] { display: none; }
.cw-add-hint button { border: 0; background: rgba(255,255,255,0.16); color: #fff; border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 12px; cursor: pointer; }
.cw-add-hint button:hover { background: var(--ochre); }

/* ---- Filter panel ---- */
.cw-filter-panel {
  position: absolute; top: 14px; right: 70px; z-index: 1100;
  width: 300px; max-height: calc(100% - 76px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
}
.cw-filter-panel[hidden] { display: none; }
.cw-filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cw-filter-head strong { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }
.cw-filter-close { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.cw-filter-panel fieldset { border: 0; margin: 0; padding: 10px 0 6px; }
.cw-filter-panel legend {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 11px; color: var(--muted); padding: 0;
}
.cw-check { display: flex; align-items: center; gap: 7px; font-size: 14px; padding: 3px 0; }
.cw-check input { accent-color: var(--pine); }
/* Icon-only toggle grid (object types / facilities) */
.cw-toggle-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 8px; }
.cw-icon-toggle { cursor: pointer; }
.cw-icon-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cw-icon-toggle img { width: 100%; aspect-ratio: 1; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-sizing: border-box; }
.cw-icon-toggle:hover img { border-color: var(--ochre); }
.cw-icon-toggle:has(input:checked) img { border-color: var(--pine); background: #e3efe6; box-shadow: inset 0 0 0 2px var(--pine); }
.cw-help {
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 1; padding: 0; margin-left: 6px;
}
.cw-help:hover { border-color: var(--ochre); color: var(--ochre); }
.cw-toggle-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 8px; }
.cw-icon-toggle { cursor: pointer; }
.cw-icon-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cw-icon-toggle img { width: 100%; aspect-ratio: 1; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-sizing: border-box; }
.cw-icon-toggle:hover img { border-color: var(--ochre); }
.cw-icon-toggle:has(input:checked) img { border-color: var(--pine); background: #e3efe6; box-shadow: inset 0 0 0 2px var(--pine); }
.cw-filter-actions { display: flex; gap: 8px; margin-top: 12px; }
.cw-filter-actions button { flex: 1; border-radius: 8px; padding: 9px; font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--paper); }
.cw-filter-actions button[type="submit"] { background: var(--pine); color: #fff; border-color: var(--pine-d); font-weight: 500; }
.cw-export { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.cw-export span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.cw-export a { color: var(--water); font-weight: 700; text-decoration: none; }

/* ---- Place page / modal content ---- */
.cw-place { max-width: 760px; margin: 0 auto; padding: 26px 18px 72px; }
.cw-breadcrumb { margin: 0 0 16px; font-family: var(--mono); font-size: 13px; }
.cw-breadcrumb a { color: var(--pine); text-decoration: none; }

.cw-place-head {
  position: relative; padding: 18px 20px; border-radius: var(--radius);
  background: var(--ink); color: #EEF1EC; overflow: hidden;
}
.cw-place-head::after {            /* faint contour wash inside the band */
  content: ""; position: absolute; inset: 0; background: url("../img/contours.svg") 0 0 / 360px; opacity: 0.5; pointer-events: none;
}
.cw-place-head > * { position: relative; }
.cw-place-head h1 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.1; }
.cw-place-coords { font-family: var(--mono); font-size: 13px; color: var(--ochre); margin-top: 6px; letter-spacing: 0.02em; }
/* Clickable place title — centres the map on the place ("find"). */
.cw-place-title-btn {
  font: inherit; color: inherit; background: transparent; border: 0; padding: 0; margin: 0;
  text-align: left; cursor: pointer; display: inline;
}
.cw-place-title-btn:hover { color: var(--ochre); }
.cw-place-title-btn:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

/* Share — icon at the modal's top-right corner, left of the close button. */
.cw-share-top {
  position: absolute; top: 12px; right: 50px; z-index: 2; width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.cw-share-top:hover { color: var(--ink); background: rgba(20,36,28,0.06); }
.cw-modal--left .cw-share-top { color: #C7D2C8; }
.cw-modal--left .cw-share-top:hover { color: #fff; background: rgba(255,255,255,0.1); }
.cw-share-top.is-copied::after {
  content: "Copied!"; position: absolute; top: 110%; right: 0; white-space: nowrap;
  background: #EEF1EC; color: var(--ink); font-family: var(--mono); font-size: 11px; padding: 3px 7px; border-radius: 5px;
}

/* Favourite shown as an action button next to Edit/Report. */
.cw-fav-btn.is-fav { color: #F0908C; border-color: rgba(240,144,140,0.6) !important; }
.cw-place-meta { font-family: var(--mono); font-size: 11px; color: #9FB3A4; margin: 10px 0 0; line-height: 1.6; }
.cw-badge.cw-type { display: inline-flex; align-items: center; gap: 5px; }
.cw-badge.cw-type img { width: 18px; height: 18px; }

/* Facility chips — pill chip (rounded border + faint bg) with an icon that fills, + label. Matches the SPA. */
.cw-icon-tags { gap: 6px; }
.cw-icon-tags li {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(128, 128, 128, 0.15); border-radius: 45px;
  background: rgba(128, 128, 128, 0.03); padding: 1px 12px 1px 3px;
}
.cw-icon-tags li img { width: 35px; height: 35px; border-radius: 25px; }

/* Navigation links */
.cw-nav-links { display: flex; gap: 10px; margin-top: 8px; }
.cw-nav-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.cw-nav-link:hover { border-color: var(--ochre); }
.cw-nav-link img { width: 26px; height: 26px; object-fit: contain; border-radius: 4px; }

/* Comment avatars + tools */
.cw-comment-row { display: flex; gap: 10px; }
.cw-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--paper); }
.cw-avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--pine); color: #fff; font-weight: 700; }
.cw-comment-main { flex: 1; min-width: 0; }
.cw-comment-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.cw-comment-tools button { border: 0; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 11px; cursor: pointer; text-decoration: underline; padding: 0; }
.cw-comment-tools button.cw-danger { color: var(--danger); }
.cw-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.cw-badge {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.12); color: #DCE6DD;
}
.cw-badge.cw-type { background: #fff; color: var(--ink); padding-left: 5px; }
.cw-badge.cw-verified {            /* rubber-stamp treatment */
  background: transparent; color: #7FE0A6; border: 1.5px solid #7FE0A6;
  transform: rotate(-3deg); font-weight: 700;
}
.cw-place-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cw-place-actions button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,0.3); background: transparent; color: #EEF1EC;
  border-radius: 8px; padding: 6px 13px; font: inherit; font-size: 13px; cursor: pointer;
}
.cw-place-actions button svg { flex: 0 0 auto; }
.cw-place-actions button:hover { border-color: var(--ochre); color: #fff; }
.cw-place-actions button.cw-danger { color: #F0B0A6; border-color: rgba(240,176,166,0.5); }
.cw-place-actions button.cw-verify-btn { color: #9BD4A0; border-color: rgba(155,212,160,0.55); }
.cw-place-actions button.cw-verify-btn:hover { border-color: #9BD4A0; color: #fff; }

/* Gallery carousel: one photo at a time, click to enlarge. */
.cw-gallery { position: relative; margin: 18px 0; border-radius: 10px; overflow: hidden; background: #000; }
.cw-slide { display: none; line-height: 0; position: relative; }
.cw-slide.is-active { display: block; }
.cw-slide img { width: 100%; height: 300px; object-fit: cover; display: block; cursor: zoom-in; }
.cw-slide .cw-gallery-del { top: 10px; right: 10px; width: 30px; height: 30px; font-size: 19px; }
.cw-slide-credit {
  position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none;
  padding: 22px 64px 8px 12px; font-family: var(--mono); font-size: 11px; line-height: 1.3; color: #fff;
  background: linear-gradient(to top, rgba(20,36,28,0.72), rgba(20,36,28,0));
}
.cw-slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(20,36,28,0.55); color: #fff; font-size: 22px; line-height: 1;
}
.cw-slide-nav:hover { background: rgba(20,36,28,0.8); }
.cw-slide-prev { left: 10px; } .cw-slide-next { right: 10px; }
.cw-slide-count {
  position: absolute; bottom: 10px; right: 12px; z-index: 2;
  font-family: var(--mono); font-size: 11px; color: #fff;
  background: rgba(20,36,28,0.6); padding: 2px 8px; border-radius: 999px;
}

.cw-section { margin-top: 26px; }
.cw-section > h2 {            /* field-guide eyebrow */
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.cw-description { line-height: 1.65; font-size: 16px; }
.cw-description a { color: var(--water); word-break: break-word; }
.cw-translate-link { display: inline-block; margin-top: 8px; border: 0; background: transparent; color: var(--water); font-family: var(--mono); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.cw-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cw-tags li { background: var(--card); border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; font-size: 14px; }

.cw-mini-map { width: 100%; height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.cw-coords { font-family: var(--mono); color: var(--ink); margin: 12px 0 4px; font-size: 14px; }
.cw-coords::before { content: "◆ "; color: var(--ochre); }
.cw-directions { font-family: var(--mono); font-size: 13px; }
.cw-directions a { color: var(--water); }

.cw-comment { background: var(--card); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.cw-comment.cw-reply { margin-left: 28px; background: #fff; }
.cw-comment-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cw-comment-body { line-height: 1.55; }
.cw-comment-report { border: 0; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 11px; cursor: pointer; text-decoration: underline; padding-left: 8px; }
.cw-muted { color: var(--muted); }

/* ---- Forms (place, report, profile) ---- */
.cw-place-form, .cw-report-form, .cw-report-done, .cw-auth-form { display: flex; flex-direction: column; gap: 13px; }
.cw-place-form h2, .cw-report-form h2 { margin: 0; font-size: 22px; }
.cw-field { display: flex; flex-direction: column; gap: 5px; }
.cw-field > span, .cw-field > legend { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cw-req { color: var(--ochre); margin-left: 3px; text-decoration: none; font-weight: 700; }
.cw-place-form input[type="text"], .cw-place-form input[type="email"], .cw-place-form input[type="number"],
.cw-place-form textarea, .cw-place-form select, .cw-report-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
.cw-place-form fieldset, .cw-report-form fieldset {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 10px; margin: 0;
}
/* Object type / facilities in the place form — icon + radio/checkbox + label, 2 cols (matches the SPA). */
.cw-iconcheck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; margin-top: 6px; }
.cw-iconcheck { display: flex; align-items: center; gap: 9px; padding: 5px 0; cursor: pointer; font-size: 14px; }
.cw-iconcheck img { width: 28px; height: 28px; flex: 0 0 auto; }
.cw-iconcheck input { accent-color: var(--pine); margin: 0; }
@media (max-width: 520px) { .cw-iconcheck-grid { grid-template-columns: 1fr; } }
/* Existing photos in the edit form */
.cw-edit-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.cw-edit-image { position: relative; }
.cw-edit-image img { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; display: block; }
.cw-img-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(20,36,28,0.7); color: #fff; font-size: 15px; line-height: 1; cursor: pointer;
}
.cw-img-del:hover { background: var(--danger); }
/* Photo drop zone */
.cw-dropzone {
  border: 2px dashed var(--line); border-radius: 10px; padding: 16px; cursor: pointer;
  background: #fff; text-align: center; transition: border-color .15s ease, background .15s ease;
}
.cw-dropzone:hover, .cw-dropzone.is-drag { border-color: var(--pine); background: #f0f5f1; }
.cw-dropzone:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.cw-dropzone-hint { margin: 0; color: var(--muted); font-size: 14px; }
.cw-dropzone-paste { font-size: 12px; opacity: 0.75; margin-top: 3px; }
.cw-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-top: 10px; }
.cw-previews:empty { margin-top: 0; }
.cw-preview { position: relative; display: block; line-height: 0; }
.cw-preview img { width: 100%; height: 64px; object-fit: cover; border-radius: 6px; }
.cw-preview-del {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  border: 0; background: rgba(20,36,28,0.7); color: #fff; font-size: 13px; line-height: 1; cursor: pointer;
}
.cw-preview-del:hover { background: var(--danger); }
.cw-coord-inputs { display: flex; gap: 8px; }
.cw-coord-inputs input { flex: 1; font-family: var(--mono); }
.cw-coord-inputs button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 0 14px; cursor: pointer; font: inherit; font-family: var(--mono); font-size: 12px; }
.cw-coords-photo { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-top: 7px; }
.cw-btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--pine); background: transparent; color: var(--pine);
  border-radius: 8px; padding: 0 13px; min-height: 38px; cursor: pointer; font: inherit; font-size: 13px;
  white-space: nowrap;
}
.cw-btn-outline:hover { background: #f0f5f1; }
.cw-coords-photo .cw-btn-outline { flex: 1 1 0; min-width: 0; }
.cw-btn-ico { font-size: 15px; line-height: 1; flex: 0 0 auto; }
.cw-coords-photo-msg { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.cw-coords-photo-msg.is-error { color: var(--danger); }
.cw-form-errors { background: #F7E9E4; color: var(--danger); border: 1px solid #E3C4BC; border-radius: 8px; padding: 9px 11px; font-size: 14px; }
/* All modal footers: cancel/secondary on the left, primary (submit) on the right. */
.cw-form-actions { display: flex; gap: 8px; margin-top: 4px; justify-content: flex-end; }
.cw-form-actions button[type="button"] { order: 1; margin-right: auto; }
.cw-form-actions button[type="submit"] { order: 2; }
.cw-form-actions button[type="submit"]:disabled { opacity: 0.45; cursor: not-allowed; }
.cw-form-actions button[type="submit"], .cw-comment-form button {
  background: var(--pine); color: #fff; border: 1px solid var(--pine-d); border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 500; cursor: pointer;
}
.cw-form-actions button[type="button"] { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 10px 18px; font: inherit; cursor: pointer; }
.cw-comment-form { margin-top: 16px; }
.cw-comment-form textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
.cw-comment-form button { align-self: flex-start; margin-top: 8px; }
.cw-saved { background: #E2EFE6; color: var(--pine); border-radius: 8px; padding: 9px 11px; }

/* ---- Modal ---- */
.cw-modal-overlay {
  position: fixed; inset: 0; z-index: 2000; background: rgba(20,36,28,0.55);
  display: flex; align-items: flex-start; justify-content: center; padding: 28px 16px; overflow-y: auto;
}
.cw-modal-overlay[hidden] { display: none !important; }
.cw-modal-dialog {
  position: relative; background: var(--card); border-radius: 14px; width: 100%; max-width: 760px;
  padding: 20px 24px 36px; box-shadow: var(--shadow); animation: cw-rise .18s ease both;
}
@keyframes cw-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cw-modal-dialog .cw-place-head { margin-top: 4px; }
.cw-modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); z-index: 2; }
.cw-modal-close:hover { color: var(--ink); }
body.cw-modal-open { overflow: hidden; }
/* SEO landing pages: country grid + type chips. */
.cw-country-grid {
  list-style: none; margin: 16px 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px;
}
.cw-country-grid a {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none;
}
.cw-country-grid a:hover { border-color: var(--ochre); }
.cw-seo-types { margin: 12px 0 20px; }
/* Offline fallback page. */
.cw-offline { text-align: center; padding: 24px 0; }
.cw-offline-cta {
  display: inline-block; margin-top: 6px; padding: 10px 22px; border-radius: 8px;
  background: var(--ochre); color: #fff; text-decoration: none;
}
.cw-offline-cta:hover { filter: brightness(1.08); }
/* Legality callout on the place panel. */
.cw-legality {
  margin: 14px 0 4px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.02);
}
.cw-legality p { margin: 6px 0 0; }
.cw-legality-tag {
  display: inline-block; font-weight: 600; font-size: 13px; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px;
}
.cw-legality-note { font-size: 12px; }
.cw-legality--allowed { border-color: rgba(31,92,63,0.45); background: rgba(31,92,63,0.10); }
.cw-legality--allowed .cw-legality-tag { background: rgba(31,92,63,0.18); color: #2f8a5c; }
.cw-legality--restricted { border-color: rgba(159,59,46,0.45); background: rgba(159,59,46,0.10); }
.cw-legality--restricted .cw-legality-tag { background: rgba(159,59,46,0.18); color: #d3786c; }
.cw-legality--varies { border-color: rgba(194,118,42,0.45); background: rgba(194,118,42,0.10); }
.cw-legality--varies .cw-legality-tag { background: rgba(194,118,42,0.20); color: #d29a52; }
/* Weather forecast row. */
.cw-weather { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-wx-day {
  flex: 1 1 92px; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px;
}
.cw-wx-date { font-size: 12px; color: var(--muted); }
.cw-wx-icon { font-size: 22px; line-height: 1.1; }
.cw-wx-temp { font-size: 14px; }
.cw-wx-pop { font-size: 11px; color: var(--water); }
.cw-wx-credit { font-size: 11px; margin-top: 6px; }
/* Announcement popup sits above the menu/place modals. */
.cw-news-popup { z-index: 2200; align-items: center; }
.cw-news-popup .cw-modal-dialog { max-width: 560px; }
.cw-news-popup-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.cw-news-popup-actions .cw-news-ok {
  background: var(--ochre); color: #fff;
  border: 0; border-radius: 8px; padding: 10px 24px; font: inherit; cursor: pointer;
}
.cw-news-popup-actions .cw-news-ok:hover { filter: brightness(1.08); }
#cw-submodal { z-index: 2600; }   /* above the place panel */

/* Place detail: docked as a left panel over the map (like the SPA), map stays usable. */
.cw-modal-overlay.cw-modal--left {
  inset: var(--header-h) auto 0 0; width: 440px; max-width: 100%;
  background: transparent; padding: 0; display: block; overflow: visible;
}
.cw-modal--left .cw-modal-dialog {
  height: 100%; width: 100%; max-width: none; border-radius: 0; overflow-y: auto;
  box-shadow: 6px 0 28px rgba(20,36,28,0.22); animation: cw-slide-left .2s ease both;
}
@keyframes cw-slide-left { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
/* A left panel must not lock body scroll (the map stays interactive). */
body.cw-modal-open:has(.cw-modal--left:not([hidden])) { overflow: auto; }
@media (max-width: 600px) { .cw-modal-overlay.cw-modal--left { width: 100%; } }

/* ---- Lightbox ---- */
.cw-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(20,36,28,0.92); display: flex; align-items: center; justify-content: center; }
.cw-lightbox[hidden] { display: none; }
.cw-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 6px; }
.cw-lb-nav, .cw-lb-close { position: absolute; background: rgba(255,255,255,0.14); color: #fff; border: 0; cursor: pointer; border-radius: 8px; }
.cw-lb-nav { top: 50%; transform: translateY(-50%); font-size: 38px; line-height: 1; padding: 4px 14px; }
.cw-lb-prev { left: 18px; } .cw-lb-next { right: 18px; }
.cw-lb-close { top: 18px; right: 18px; font-size: 26px; line-height: 1; padding: 2px 12px; }
.cw-lb-del {
  position: absolute; top: 18px; right: 66px; background: rgba(255,255,255,0.14); color: #fff;
  border: 0; cursor: pointer; border-radius: 8px; padding: 8px 11px; display: inline-flex; align-items: center;
}
.cw-lb-del[hidden] { display: none; }
.cw-lb-del:hover { background: var(--danger); }
.cw-lb-credit {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); max-width: 90vw;
  color: #fff; font-family: var(--mono); font-size: 12px; background: rgba(20,36,28,0.6);
  padding: 5px 12px; border-radius: 6px; text-align: center;
}
.cw-lb-credit[hidden] { display: none; }

/* ---- Info modals ---- */
.cw-info h2 { margin-top: 0; font-size: 22px; }
.cw-info section { margin-top: 16px; }
.cw-info h3 { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 6px; }
.cw-list { list-style: none; padding: 0; margin: 0; }
.cw-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.cw-leaders { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: rank; }
.cw-leaders li { display: flex; gap: 11px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cw-leaders li::before { counter-increment: rank; content: counter(rank, decimal-leading-zero); font-family: var(--mono); color: var(--ochre); font-size: 13px; flex: 0 0 auto; }
.cw-leader-name { flex: 1; }
.cw-leader-count { font-family: var(--mono); font-weight: 700; color: var(--pine); }

/* Tabs (activities) */
.cw-tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 12px; flex-wrap: wrap; }
.cw-tabbar button {
  border: 0; background: transparent; font: inherit; font-family: var(--mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  padding: 8px 11px; margin-bottom: -1px; border-bottom: 2px solid transparent; cursor: pointer;
}
.cw-tabbar button:hover { color: var(--ink); }
.cw-tabbar button.is-active { color: var(--pine); border-bottom-color: var(--pine); }

/* Activity cards */
.cw-act-list { display: flex; flex-direction: column; }
.cw-act-list[hidden] { display: none; }
.cw-act-card { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; align-items: flex-start; }
.cw-act-card:hover .cw-act-name { color: var(--pine); }
.cw-act-thumb { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 8px; background: var(--paper); overflow: hidden; }
.cw-act-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-act-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cw-act-name { font-size: 15px; }
.cw-act-desc { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.cw-act-when { font-family: var(--mono); font-size: 11px; color: var(--ochre); }
.cw-act-comment .cw-avatar { margin: 2px 0; }
.cw-type-help { list-style: none; padding: 0; margin: 10px 0 0; }
.cw-type-help li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cw-legal { line-height: 1.6; }
.cw-legal h3 { margin-top: 18px; }

/* ---- Auth ---- */
.cw-auth { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - var(--header-h)); padding: 24px 16px; }
.cw-auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.cw-auth-card::before { content: ""; position: absolute; inset: 0; background: url("../img/contours.svg") 0 0 / 360px; opacity: 0.5; }
.cw-auth-card > * { position: relative; }
.cw-auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.cw-btn-google { display: block; text-align: center; margin-top: 18px; padding: 12px; border: 1px solid var(--ink); border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; background: #fff; }
.cw-btn-google:hover { background: var(--ink); color: #fff; }
.cw-auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 18px 0; font-family: var(--mono); font-size: 12px; }
.cw-auth-divider::before, .cw-auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cw-auth-form input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.cw-auth-form button { background: var(--pine); color: #fff; border: 0; border-radius: 8px; padding: 11px; font: inherit; font-weight: 500; cursor: pointer; }
.cw-auth-back { margin-top: 16px; font-family: var(--mono); font-size: 13px; }
.cw-auth-back a { color: var(--pine); text-decoration: none; }

/* ---- A11y / motion ---- */
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 600px) { .cw-place-head h1 { font-size: 23px; } .cw-add-btn { right: 14px; top: 56px; } }
