/* Everything below uses the Plugable Design System tokens (ds/tokens.css, v1.1). */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; flex-direction: column; background: var(--plg-surface-sunken);
  font-family: var(--plg-font-sans); font-weight: var(--plg-weight-body); color: var(--plg-on-surface);
  font-size: var(--plg-text-xs); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: var(--plg-font-sans); }

header {
  background: var(--plg-surface); border-bottom: 1px solid var(--plg-border);
  padding: var(--plg-space-4) var(--plg-space-8); display: flex; align-items: center; gap: var(--plg-space-8); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: var(--plg-space-5); }
.brand img { width: 132px; height: auto; display: block; }
.brand .divider { width: 1px; height: 40px; background: var(--plg-border); }
.eyebrow { font-size: var(--plg-text-xs); font-weight: var(--plg-weight-label); letter-spacing: .14em; text-transform: uppercase; color: var(--plg-primary-1); }
h1 { margin: 0; font-family: var(--plg-font-display); font-weight: var(--plg-weight-heading); font-size: var(--plg-text-xl); line-height: 1.1; letter-spacing: -0.02em; }

.stats { display: flex; margin-left: auto; border-left: 1px solid var(--plg-ink-100); }
.stat { padding: var(--plg-space-1) var(--plg-space-6); border-right: 1px solid var(--plg-ink-100); }
.stat b { display: block; font-family: var(--plg-font-display); font-weight: 700; font-size: var(--plg-text-xl); line-height: 1; letter-spacing: -0.02em; color: var(--plg-green-700); }
.stat small { display: block; margin-top: var(--plg-space-1); font-size: var(--plg-text-xs); font-weight: var(--plg-weight-label); letter-spacing: .1em; text-transform: uppercase; color: var(--plg-ink-600); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--plg-space-2);
  padding: var(--plg-space-3) var(--plg-space-5); border: 0; border-radius: var(--plg-radius-md);
  font-size: var(--plg-text-sm); font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--plg-ease-out), transform .15s var(--plg-ease-out);
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--plg-green-700); color: #fff; box-shadow: var(--plg-shadow-green); }
.btn-primary:hover { background: var(--plg-green-800); }
.btn-secondary { background: var(--plg-surface); color: var(--plg-ink-900); border: 1px solid var(--plg-ink-300); }
.btn-secondary:hover { background: var(--plg-ink-050); }
.btn-ghost { background: transparent; color: var(--plg-green-700); padding: var(--plg-space-2) 0; font-size: var(--plg-text-xs); }
.btn-ghost:hover { color: var(--plg-green-600); text-decoration: underline; }

.proto {
  display: flex; gap: var(--plg-space-3); align-items: center; padding: var(--plg-space-2) var(--plg-space-8);
  background: var(--plg-warning-bg); border-left: 3px solid var(--plg-warning); color: var(--plg-ink-700); font-size: var(--plg-text-xs);
}
.proto svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--plg-warning); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* The map is the full-bleed backdrop; the list floats over it as a glass panel (DS "Surfaces & Panels"). */
main { flex: 1; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }
aside.plg-glass {
  position: absolute; z-index: 500; top: var(--plg-space-5); left: var(--plg-space-5); bottom: var(--plg-space-5);
  width: 400px; display: flex; flex-direction: column; overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
}
.intro { padding: var(--plg-space-6) var(--plg-space-6) var(--plg-space-3); }
.intro p { margin: var(--plg-space-2) 0 0; font-size: var(--plg-text-xs); line-height: 1.5; color: var(--plg-on-surface-mut); }
.intro strong { color: var(--plg-on-surface); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: var(--plg-space-2); padding: var(--plg-space-2) var(--plg-space-6) var(--plg-space-4); border-bottom: 1px solid var(--plg-border); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--plg-radius-pill);
  background: var(--plg-surface); border: 1px solid var(--plg-ink-200); color: var(--plg-ink-700);
  font-size: var(--plg-text-xs); font-weight: 600; letter-spacing: .02em; cursor: pointer;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip[aria-pressed="true"] { background: var(--plg-green-700); border-color: var(--plg-green-700); color: #fff; }
.feed { overflow-y: auto; flex: 1; }
.item { display: flex; gap: var(--plg-space-4); padding: var(--plg-space-4) var(--plg-space-6); border-bottom: 1px solid var(--plg-border); cursor: pointer; transition: background .15s var(--plg-ease-out); }
.item:hover { background: var(--plg-green-050); }
.thumb { width: 64px; height: 64px; border-radius: var(--plg-radius-md); flex: none; object-fit: cover; background: var(--plg-green-100); display: grid; place-items: center; }
.thumb-wrap { position: relative; flex: none; }
.thumb-n { position: absolute; right: -6px; bottom: -6px; background: var(--plg-ink-900); color: #fff; font-size: var(--plg-text-xs); font-weight: 600; line-height: 1; border-radius: var(--plg-radius-pill); padding: 3px 7px; border: 2px solid #fff; }
.item h3 { margin: 0 0 2px; font-family: var(--plg-font-display); font-weight: 700; font-size: var(--plg-text-sm); line-height: 1.25; }
.item p { margin: 0; font-size: var(--plg-text-xs); color: var(--plg-on-surface-mut); line-height: 1.4; }
.meta { font-size: var(--plg-text-xs); color: var(--plg-ink-500); margin-top: var(--plg-space-1); }
.badge { display: inline-flex; align-items: center; padding: 1px 9px; margin-left: 6px; border-radius: var(--plg-radius-pill); font-size: var(--plg-text-xs); font-weight: 600; letter-spacing: .04em; vertical-align: 2px; font-family: var(--plg-font-sans); }
.badge.pending { background: var(--plg-warning-bg); color: var(--plg-warning); }
.badge.sample { background: var(--plg-surface); border: 1px solid var(--plg-ink-200); color: var(--plg-ink-600); }

/* Leaflet chrome restyled as DS cards */
.leaflet-popup-content-wrapper { border-radius: var(--plg-radius-lg); box-shadow: var(--plg-shadow-lg); padding: 0; }
.leaflet-popup-content { margin: var(--plg-space-3); }
.leaflet-container { font-family: var(--plg-font-sans); }
.leaflet-bar a { color: var(--plg-ink-800); }
.leaflet-top.leaflet-left { left: 430px; }
.pop { width: 260px; }
.gal { position: relative; margin-bottom: var(--plg-space-3); }
.gal img { width: 100%; height: 260px; object-fit: cover; border-radius: var(--plg-radius-md); display: block; cursor: zoom-in; }
.gal-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--plg-glass-border);
  background: var(--plg-glass-bg); -webkit-backdrop-filter: var(--plg-glass-blur); backdrop-filter: var(--plg-glass-blur);
  color: var(--plg-ink-900); font-size: 22px; line-height: 30px; cursor: pointer; padding: 0; box-shadow: var(--plg-shadow-sm);
}
.gal-btn.prev { left: 8px; } .gal-btn.next { right: 8px; }
.gal-count { position: absolute; bottom: 8px; right: 8px; background: rgba(26,26,26,.72); color: #fff; font-size: var(--plg-text-xs); font-weight: 600; line-height: 1; padding: 4px 9px; border-radius: var(--plg-radius-pill); }
.pop h3 { margin: 0; font-family: var(--plg-font-display); font-weight: 700; font-size: var(--plg-text-sm); color: var(--plg-on-surface); }
.pop .who { font-size: var(--plg-text-xs); color: var(--plg-ink-500); margin: 2px 0 var(--plg-space-2); }
.pop p { margin: 0; font-size: var(--plg-text-xs); line-height: 1.45; color: var(--plg-on-surface-mut); }
.pop p + p { margin-top: var(--plg-space-2); }

.lightbox { position: fixed; inset: 0; background: rgba(26,26,26,.92); z-index: 3000; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { max-width: 88vw; max-height: 82vh; border-radius: var(--plg-radius-lg); display: block; box-shadow: var(--plg-shadow-xl); }
.lightbox figcaption { color: var(--plg-ink-200); margin-top: var(--plg-space-3); font-size: var(--plg-text-xs); font-weight: 600; letter-spacing: .04em; }
.lb-nav, .lb-close { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; cursor: pointer; font-size: 28px; line-height: 44px; width: 50px; height: 50px; padding: 0; }
.lb-nav:hover, .lb-close:hover { background: rgba(255,255,255,.24); }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); } .lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 18px; right: 18px; }

dialog {
  border: 1px solid var(--plg-border); border-radius: var(--plg-radius-xl); padding: 0; width: min(560px, 94vw);
  box-shadow: var(--plg-shadow-xl); color: var(--plg-on-surface);
}
dialog::backdrop { background: rgba(0, 48, 31, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
form { padding: var(--plg-space-8); }
form h2 { margin: var(--plg-space-2) 0 var(--plg-space-2); font-family: var(--plg-font-display); font-weight: 700; font-size: var(--plg-text-lg); letter-spacing: -0.01em; }
form .sub { margin: 0 0 var(--plg-space-4); color: var(--plg-on-surface-mut); font-size: var(--plg-text-xs); line-height: 1.5; }
label { display: block; font-weight: 600; font-size: var(--plg-text-xs); margin: var(--plg-space-4) 0 var(--plg-space-2); color: var(--plg-ink-800); }
label .opt { font-weight: 400; color: var(--plg-ink-500); }
input[type=text], select, textarea {
  width: 100%; border: 1px solid var(--plg-ink-300); border-radius: var(--plg-radius-md); padding: 11px 12px;
  font-size: var(--plg-text-xs); color: var(--plg-on-surface); background: var(--plg-surface);
  transition: border-color .15s var(--plg-ease-out), box-shadow .15s var(--plg-ease-out);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plg-green-500); box-shadow: 0 0 0 3px var(--plg-green-100); }
textarea { resize: vertical; min-height: 76px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--plg-space-3); }
.loc { position: relative; }
.results { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; background: var(--plg-surface); border: 1px solid var(--plg-border); border-radius: var(--plg-radius-md); margin-top: var(--plg-space-1); overflow: hidden; box-shadow: var(--plg-shadow-md); }
.results button { display: block; width: 100%; text-align: left; border: 0; background: var(--plg-surface); padding: 10px 12px; font-size: var(--plg-text-xs); color: var(--plg-on-surface); cursor: pointer; }
.results button:hover { background: var(--plg-green-050); }
.loc-actions { display: flex; gap: var(--plg-space-6); margin-top: var(--plg-space-1); }
.picked { margin-top: var(--plg-space-1); font-size: var(--plg-text-xs); color: var(--plg-green-700); font-weight: 600; min-height: 20px; display: flex; align-items: center; gap: 6px; }
.drop {
  border: 1.5px dashed var(--plg-ink-300); border-radius: var(--plg-radius-lg); padding: var(--plg-space-5); text-align: center;
  color: var(--plg-on-surface-mut); font-size: var(--plg-text-xs); cursor: pointer; background: var(--plg-surface-sunken);
  display: flex; flex-direction: column; align-items: center; gap: var(--plg-space-2);
}
.drop:hover { border-color: var(--plg-green-500); background: var(--plg-green-050); }
.drop.has { padding: var(--plg-space-2); border-style: solid; background: var(--plg-surface); }
.drop img { max-width: 100%; max-height: 200px; border-radius: var(--plg-radius-md); display: block; margin: 0 auto; }
.icon { width: 24px; height: 24px; fill: none; stroke: var(--plg-primary-1); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.link { background: none; border: 0; padding: 0; color: var(--plg-green-700); font-size: var(--plg-text-xs); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.check { display: flex; gap: var(--plg-space-2); align-items: flex-start; font-weight: 400; font-size: var(--plg-text-xs); color: var(--plg-on-surface-mut); margin-top: var(--plg-space-3); line-height: 1.4; }
.check input { margin-top: 3px; accent-color: var(--plg-green-700); width: 16px; height: 16px; }
.callout { border-left: 3px solid var(--plg-ink-600); background: var(--plg-ink-050); padding: var(--plg-space-3) var(--plg-space-4); border-radius: 0 var(--plg-radius-md) var(--plg-radius-md) 0; display: flex; gap: var(--plg-space-3); margin-top: var(--plg-space-4); }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: var(--plg-ink-700); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.callout div { font-size: var(--plg-text-xs); color: var(--plg-ink-700); line-height: 1.45; }
.actions { display: flex; justify-content: flex-end; gap: var(--plg-space-3); margin-top: var(--plg-space-6); }
.err { color: var(--plg-danger); font-size: var(--plg-text-xs); margin-top: var(--plg-space-3); min-height: 20px; }
.picking #map { cursor: crosshair; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2000; display: none; max-width: 90vw;
  background: var(--plg-ink-900); color: #fff; padding: var(--plg-space-3) var(--plg-space-5); border-radius: var(--plg-radius-md);
  font-size: var(--plg-text-xs); box-shadow: var(--plg-shadow-lg);
}

@media (max-width: 900px) {
  header { padding: var(--plg-space-3) var(--plg-space-4); gap: var(--plg-space-4); }
  .brand img { width: 104px; }
  .stats { margin-left: 0; border-left: 0; }
  .stat:first-child { padding-left: 0; }
  .stat { padding: 0 var(--plg-space-4); }
  .stat small { white-space: nowrap; letter-spacing: .06em; }
  h1 { font-size: var(--plg-text-lg); }
  .brand .divider { height: 32px; }
  .proto { padding: var(--plg-space-2) var(--plg-space-4); }
  /* Phones stack the map above the check-ins and scroll as one page. The wide layout pins the
     page to the window height, which on a phone squeezed the panel and cut off filters and feed. */
  html, body { height: auto; }
  body { display: block; min-height: 100%; }
  main { display: block; }
  #map { position: relative; height: 55vh; height: 55svh; }
  aside.plg-glass { position: static; width: auto; overflow: visible; border-radius: 0; border: 0; box-shadow: none; background: var(--plg-surface); }
  .feed { overflow: visible; }
  .leaflet-top.leaflet-left { left: 0; }
  .row { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Additions for the games-site security rules (no inline styles anywhere),
   the self-hosted map background, and the email fields.
   --------------------------------------------------------------------------- */
.dot-team     { background: #006341; }
.dot-partner  { background: #2e67b1; }
.dot-customer { background: #c47838; }
.dot-fan      { background: #ee4455; }

.toast.show { display: block; }

/* The photo preview is a canvas: the rules block inline (data URI) and blob images. */
.drop canvas { max-width: 100%; max-height: 200px; border-radius: var(--plg-radius-md); display: block; margin: 0 auto; }
.drop .link { margin-top: 6px; }
.hint { margin: var(--plg-space-1) 0 0; font-size: var(--plg-text-xs); color: var(--plg-ink-500); line-height: 1.4; }
input[type=email] {
  width: 100%; border: 1px solid var(--plg-ink-300); border-radius: var(--plg-radius-md); padding: 11px 12px;
  font-size: var(--plg-text-xs); color: var(--plg-on-surface); background: var(--plg-surface);
  transition: border-color .15s var(--plg-ease-out), box-shadow .15s var(--plg-ease-out);
}
.check input { flex: none; }
.results .none { padding: 10px 12px; font-size: var(--plg-text-xs); color: var(--plg-ink-500); }

/* Map background: water is the container, land and borders are drawn shapes. */
.leaflet-container { background: #dfe6e8; }
.ww-label {
  font-family: var(--plg-font-sans); white-space: nowrap; pointer-events: none;
  transform: translate(-50%, -50%); width: max-content;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.ww-label-country { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--plg-ink-500); }
.ww-label-city { font-size: 12px; color: var(--plg-ink-600); }
.ww-label-city::before {
  content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--plg-ink-500); margin-right: 4px; vertical-align: 2px;
}

/* Buttons that are links: keep button colours instead of the global link hover. */
a.btn { text-decoration: none; }
a.btn-primary, a.btn-primary:hover { color: #fff; text-decoration: none; }
a.btn-secondary, a.btn-secondary:hover { color: var(--plg-ink-900); text-decoration: none; }
.btn.is-disabled { opacity: .6; cursor: default; box-shadow: none; }

/* Spam trap: invisible to people, so only bots fill it in. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
