/* Christmas Lights Map – one stylesheet, mobile first. */
:root {
  --night: #0b1d33;
  --night-2: #13304f;
  --ink: #1b2430;
  --muted: #5f6b7a;
  --line: #dde3ea;
  --bg: #f6f7f9;
  --card: #fff;
  --red: #c62828;
  --red-dark: #9e1c1c;
  --gold: #f6b400;
  --green: #1f8a4c;
  --confirmed: #f6b400;
  --unconfirmed: #7d8ea3;
  --reported: #b23a3a;
  --seen: #1f8a4c;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(11, 29, 51, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
a { color: #1559b5; }
h1, h2 { line-height: 1.2; }
h1 { font-size: 1.6rem; margin: .2em 0 .5em; }
h2 { font-size: 1.15rem; margin: .2em 0 .5em; }
code { background: #eef1f5; padding: 0 .3em; border-radius: 4px; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.pre { white-space: pre-line; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; left: -9999px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 9999; background: #fff; padding: 8px; }
[hidden] { display: none !important; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; background: var(--night); color: #fff; position: relative; z-index: 1001;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a, .site-nav .linkish { color: #dfe8f3; text-decoration: none; padding: 6px 8px; border-radius: 8px; font-size: .95rem; }
.site-nav a[aria-current="page"] { background: var(--night-2); color: #fff; }
.site-nav .nav-add { background: var(--red); color: #fff; font-weight: 600; }
@media (max-width: 480px) { .site-nav a[href="/about"] { display: none; } .site-nav a[href="/"] { display: none; } }
.banner { background: #fff4cf; color: #5b4500; text-align: center; padding: 6px 12px; font-size: .9rem; }

/* Buttons + forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--red);
  background: var(--red); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f1f4f7; }
.btn-small { min-height: 34px; padding: 4px 10px; font-size: .9rem; }
.btn-big { min-height: 52px; font-size: 1.05rem; width: 100%; }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #fdecec; }
.btn-lit { background: var(--gold); border-color: #d99e00; color: #2b2100; }
.btn-lit:hover { background: #e8a900; }
.is-picked { outline: 3px solid rgba(31, 138, 76, .45); outline-offset: 1px; }
.btn.is-picked.btn-ghost { background: #e9f6ee; border-color: var(--green); color: #135a31; }
.linkish { background: none; border: 0; padding: 0; color: #1559b5; font: inherit; cursor: pointer; text-decoration: underline; text-align: left; }
label { display: block; margin: 10px 0; font-weight: 500; }
input[type=text], input[type=search], input[type=email], input[type=url], input[type=password], input[type=number], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; font-size: 16px;
  border: 1px solid #c4ccd6; border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 10px 0; }
legend { font-weight: 600; margin-bottom: 6px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; margin-top: 0; min-width: 0; }
.row.wrap label { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 500; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--green); background: #e9f6ee; }
.toggle { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.toggle input { width: 20px; height: 20px; }
.form-msg { min-height: 1.4em; color: var(--red-dark); font-weight: 500; }
.field-error { display: block; color: var(--red); font-size: .875rem; }
.flash { padding: 10px 12px; border-radius: 10px; margin: 8px 0; }
.flash-ok { background: #e9f6ee; color: #135a31; }
.flash-error { background: #fdecec; color: #8a1c1c; }
.flash-warn { background: #fff4cf; color: #5b4500; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card.narrow { max-width: 420px; margin: 32px auto; }
.card.warn { border-color: #e5c766; background: #fffaf0; }
.prose, .submit-page, .display-page { max-width: 720px; margin: 0 auto; padding: 16px; }
.site-footer { text-align: center; padding: 24px 16px calc(24px + var(--safe-b)); color: var(--muted); font-size: .9rem; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 120px); background: var(--night); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 3000; transition: transform .25s; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.show { transform: translate(-50%, 0); }
.toast-error { background: var(--red-dark); }

/* Status dots + pins */
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); vertical-align: middle; margin-right: 6px; flex: none; }
.dot-confirmed { background: var(--confirmed); }
.dot-unconfirmed { background: var(--unconfirmed); }
.dot-reported { background: var(--reported); }
.dot-seen { background: var(--seen); }

/* Map page */
.page-map { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.page-map main { flex: 1; min-height: 0; }
.map-layout { display: flex; height: 100%; }
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #dfe6ec; }
.map-search { position: absolute; top: 10px; left: 10px; right: 64px; z-index: 1000; display: flex; max-width: 460px; }
.map-search input { margin: 0; border-radius: 10px 0 0 10px; box-shadow: var(--shadow); border-right: 0; }
.map-search button { border: 1px solid #c4ccd6; border-left: 0; background: var(--red); color: #fff; font-weight: 600; padding: 0 14px; border-radius: 0 10px 10px 0; box-shadow: var(--shadow); cursor: pointer; }
.search-results { position: absolute; top: 48px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: #fff; border-radius: 10px; box-shadow: var(--shadow); max-height: 50vh; overflow: auto; }
.search-results li { padding: 0; }
.search-results li.muted { padding: 10px; }
.search-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px; font: inherit; cursor: pointer; border-radius: 8px; }
.search-results button:hover { background: #f1f4f7; }
.map-buttons { position: absolute; top: 10px; right: 10px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.fab { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--night); font-size: 20px; box-shadow: var(--shadow); cursor: pointer; }
.fab[aria-expanded="true"] { background: var(--night); color: #fff; }
.fab-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; line-height: 20px; font-weight: 700; }
.legend { position: absolute; left: 10px; bottom: calc(24px + var(--safe-b)); z-index: 999; background: rgba(255,255,255,.92); border-radius: 10px; padding: 6px 10px; font-size: .78rem; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.map-note { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 999; background: var(--night); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: .85rem; white-space: nowrap; }
.panel, .sheet {
  position: absolute; z-index: 1002; left: 0; right: 0; bottom: 0; max-height: 75%; overflow: auto;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: var(--shadow); padding: 14px 16px calc(16px + var(--safe-b));
  animation: slideup .2s ease-out;
}
@keyframes slideup { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel-close { border: 0; background: #eef1f5; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.sheet-close { position: absolute; top: 10px; right: 10px; }
.seen-list { padding-left: 1.4em; }
.seen-list li { margin: 6px 0; }

/* Details card */
.details-title { margin-right: 44px; }
.details-address { margin: 0 0 6px; }
.status-line { font-weight: 600; margin: 8px 0; }
.status-confirmed { color: #7a5a00; }
.status-reported { color: var(--reported); }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.type-chip { background: #eef1f5; border-radius: 999px; padding: 3px 10px; font-size: .85rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0; }
.facts dt { font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; }
.details-desc { white-space: pre-line; }
.btn-row { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; align-items: center; }
.btn-row .btn { flex: 1 1 140px; }
.btn-row.directions .btn { flex: 0 1 auto; }
.details-foot { margin-top: 12px; }

/* Side list (desktop) */
.side-list { display: none; }
@media (min-width: 900px) {
  .side-list { display: flex; flex-direction: column; width: 360px; border-left: 1px solid var(--line); background: #fff; }
  .side-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .side-head h2 { margin: 0; }
  #list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
  #list li.empty { padding: 16px; }
  .list-item { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eef1f5; background: none; padding: 10px 14px; font: inherit; cursor: pointer; }
  .list-item:hover { background: #f6f8fa; }
  .list-item .dot { margin-top: 4px; }
  .list-text { display: flex; flex-direction: column; min-width: 0; }
  .list-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-foot { padding: 8px 14px; border-top: 1px solid var(--line); }
  .panel, .sheet { left: 12px; right: auto; bottom: 12px; width: 380px; max-height: calc(100% - 80px); border-radius: 16px; }
  .legend { bottom: 24px; left: auto; right: 60px; }
}

/* Display page */
.display-page { padding-top: 0; }
.display-map { height: 240px; margin: 0 -16px; }
@media (min-width: 720px) { .display-map { height: 320px; margin: 16px 0 0; border-radius: var(--radius); } }
.display-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: -24px; position: relative; z-index: 500; box-shadow: var(--shadow); }
.report { margin-top: 24px; }
.back { margin-top: 16px; }

/* Submit */
.steps { list-style: none; margin: 0; padding: 0; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; scroll-margin-top: 12px; }
.choices { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.choice { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; font: inherit; cursor: pointer; }
.choice:hover { background: #f6f8fa; }
.choice.is-picked { border-color: var(--green); background: #e9f6ee; outline: none; }
.mini-map { height: 300px; border-radius: 10px; margin: 8px 0; background: #dfe6ec; }
.mini-map.tall { height: 360px; }
.turnstile { margin: 12px 0; min-height: 65px; }

/* Admin */
.admin-main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.inline { display: inline; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); text-decoration: none; }
.stat b { display: block; font-size: 2rem; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.toolbar input, .toolbar select { width: auto; margin: 0; flex: 1 1 200px; }
.queue-item { display: grid; gap: 16px; }
.queue-item .mini-map { height: 220px; margin: 0; }
@media (min-width: 760px) { .queue-item { grid-template-columns: 320px 1fr; } }
.queue-item p { margin: 4px 0; }
.pick { margin: 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.voided td { color: var(--muted); text-decoration: line-through; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef1f5; vertical-align: middle; }
.tag-approved { background: #e9f6ee; color: #135a31; }
.tag-pending { background: #fff4cf; color: #5b4500; }
.tag-rejected, .tag-removed { background: #fdecec; color: #8a1c1c; }
.grid2, .grid3 { display: grid; gap: 0 12px; }
@media (min-width: 600px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
input.short { width: 120px; display: inline-block; }
.pager { display: flex; gap: 16px; justify-content: center; }

/* ---- Phase 2: My tour ---------------------------------------------- */
.tour-summary { margin: 4px 0 10px; }
.tour-start-box { margin: 0 0 10px; }
.tour-start-box .toggle { display: inline-flex; margin: 4px 16px 4px 0; }
.tour-stops { list-style: none; margin: 0 0 8px; padding: 0; }
.tour-stop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid #eef1f5; background: #fff; }
.tour-stop.dragging { opacity: .85; box-shadow: var(--shadow); border-radius: 8px; position: relative; z-index: 2; }
.tour-stop.is-seen .tour-name { text-decoration: line-through; color: var(--muted); }
.drag-handle { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; font-size: 20px; color: var(--muted); padding: 6px 4px; }
.tour-num { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--night); border: 2px solid var(--gold); color: #fff; font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; }
.tour-stop.is-seen .tour-num { background: var(--seen); border-color: var(--seen); }
.tour-text { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; }
.tour-controls { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.tour-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tour-seen { display: inline-flex; align-items: center; gap: 4px; margin: 0; flex: none; }
.tour-seen input { width: 20px; height: 20px; }
.tour-tools { display: inline-flex; gap: 2px; flex: none; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 16px; cursor: pointer; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.tour-links h3 { font-size: 1rem; margin: 14px 0 6px; }
.tour-links summary { cursor: pointer; font-weight: 600; margin: 14px 0 6px; }
.btn-leg { margin: 0 6px 6px 0; }
.apple-links li { margin: 6px 0; }
.tour-pin span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 8px; background: var(--night); color: #fff; font: 700 13px/1 system-ui, sans-serif; border: 3px solid var(--gold); box-shadow: 0 1px 5px rgba(0,0,0,.5); }
.tour-pin-seen span { background: var(--seen); border-color: #fff; }
.tour-start span { display: block; text-align: center; background: var(--night); color: #fff; font: 700 12px/24px system-ui, sans-serif; border-radius: 12px; border: 2px solid #fff; }
.btn-tour { flex: 1 1 100%; }
.tour-page { max-width: 900px; margin: 0 auto; padding: 0 16px 16px; }
.tour-map { height: 300px; margin: 0 -16px; }
@media (min-width: 720px) { .tour-map { height: 380px; margin: 16px 0 0; border-radius: var(--radius); } }
.tour-card { margin-top: -24px; position: relative; z-index: 500; box-shadow: var(--shadow); }
.page-tour .tour-tools, .page-tour .drag-handle { display: none; }

/* ---- Kinds, owner listings, reports, edit links ---------------------- */
.kind-line { margin: 4px 0; font-weight: 600; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kind-commercial, .kind-public { color: #6a3fb0; }
.owner-badge { font-size: .78rem; font-weight: 700; background: #e9f6ee; color: #135a31; border-radius: 999px; padding: 2px 8px; }
.report-section { margin: 12px 0; border-top: 1px solid var(--line); padding-top: 10px; }
.report-section summary { cursor: pointer; font-weight: 600; }
.edit-link-box { text-align: left; }
.edit-link-box input { font-size: 14px; }
.owner-check { margin-top: 12px; }
.choice .approx { display: block; font-size: .8rem; color: #7a5a00; }
.form-msg.ok { color: #135a31; }

/* =====================================================================
   THEME: Night Lights (chosen from the mockups)
   Dark UI, darkened map, glowing bulb pins, string lights, light snow.
   Admin pages keep the plain light look for long working sessions.
   ===================================================================== */
@font-face {
  font-family: "Berkshire Swash";
  src: url(../fonts/berkshire-swash.woff2) format("woff2");
  font-display: swap;
}
body:not(.page-admin) {
  --night: #07121c; --night-2: #12263a; --red: #d7263d; --red-dark: #a81b2e;
  --bg: #0b1724; --card: #102232; --ink: #eef3f8; --muted: #a3b3c4; --line: #223c55;
  --confirmed: #ffc61a; --unconfirmed: #c9d2dc; --reported: #e05555; --seen: #2fbf5b;
  --gold: #ffd76a;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  background: var(--bg); color: var(--ink);
}
body:not(.page-admin) a:not(.btn):not(.brand), body:not(.page-admin) .linkish { color: #8cc8ff; }
body:not(.page-admin) .site-nav a { color: #dfe8f3; }
body:not(.page-admin) .site-nav a.nav-add, body:not(.page-admin) a.btn:not(.btn-ghost) { color: #fff; }
body:not(.page-admin) a.btn-ghost { color: var(--ink); }
body:not(.page-admin) h1, body:not(.page-admin) h2, body:not(.page-admin) .details-title {
  font-family: "Berkshire Swash", Georgia, serif; font-weight: 400; color: #ffe9a8; letter-spacing: .2px;
}
body:not(.page-admin) h3 { color: #ffe9a8; }
.details-title { font-size: 1.6rem; }

/* Header with a string of lights */
.site-header { background: #07121c; padding-bottom: 12px; position: relative; }
.brand { font-family: "Berkshire Swash", Georgia, serif; font-size: 1.45rem; font-weight: 400; color: var(--gold, #ffd76a); text-shadow: 0 0 10px rgba(255, 215, 106, .55); }
.page-admin .brand { font-size: 1.2rem; }
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -16px; height: 20px; pointer-events: none; z-index: 1002;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='20'%3E%3Cpath d='M0 2 Q15 9 30 2 T60 2 T90 2 T120 2' stroke='%23263b2e' fill='none' stroke-width='1.4'/%3E%3Crect x='13.5' y='5' width='3' height='3' fill='%23263b2e'/%3E%3Cellipse cx='15' cy='12' rx='3.6' ry='5' fill='%23ff3b3b'/%3E%3Crect x='43.5' y='5' width='3' height='3' fill='%23263b2e'/%3E%3Cellipse cx='45' cy='12' rx='3.6' ry='5' fill='%23ffc61a'/%3E%3Crect x='73.5' y='5' width='3' height='3' fill='%23263b2e'/%3E%3Cellipse cx='75' cy='12' rx='3.6' ry='5' fill='%2333d17a'/%3E%3Crect x='103.5' y='5' width='3' height='3' fill='%23263b2e'/%3E%3Cellipse cx='105' cy='12' rx='3.6' ry='5' fill='%233fa9ff'/%3E%3C/svg%3E") repeat-x;
  filter: drop-shadow(0 0 3px rgba(255, 220, 120, .7));
}
.banner { position: relative; z-index: 1001; margin-top: 4px; background: #1d2f12; color: #ffe9a8; }

/* Darkened map (body.dark-map, from config map.dark) */
.dark-map .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(.82) contrast(.92) saturate(.6); }
.dark-map .leaflet-container { background: #1b2733; }
.leaflet-control-attribution { background: rgba(7, 18, 28, .8) !important; color: #a3b3c4; }
.leaflet-control-attribution a { color: #8cc8ff !important; }
.leaflet-bar a { background: #102232; color: #eef3f8; border-color: #223c55; }
.dot { border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; border-color: rgba(255,255,255,.85); }

/* Light snowfall on the map (off for people who prefer less motion) */
.map-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 900; opacity: .7;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(2px 2px at 80px 120px, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 150px 60px, #fff 50%, transparent 51%), radial-gradient(2.5px 2.5px at 200px 160px, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 260px 20px, #fff 50%, transparent 51%), radial-gradient(2px 2px at 120px 200px, #fff 50%, transparent 51%);
  background-size: 300px 240px; animation: snowfall 14s linear infinite;
}
@keyframes snowfall { from { background-position: 0 0; } to { background-position: 60px 240px; } }
@media (prefers-reduced-motion: reduce) { .map-wrap::after { animation: none; opacity: .35; } }

/* Surfaces */
body:not(.page-admin) .panel, body:not(.page-admin) .sheet, body:not(.page-admin) .side-list,
body:not(.page-admin) .card, body:not(.page-admin) .step, body:not(.page-admin) .display-card,
body:not(.page-admin) .search-results, body:not(.page-admin) .legend { background: var(--card); color: var(--ink); }
body:not(.page-admin) .panel, body:not(.page-admin) .sheet { border-top: 1px solid #2b4763; }
body:not(.page-admin) .card, body:not(.page-admin) .step, body:not(.page-admin) .display-card { border-color: var(--line); }
body:not(.page-admin) .panel-close { background: #1d3550; color: #fff; }
body:not(.page-admin) .btn-ghost, body:not(.page-admin) .icon-btn, body:not(.page-admin) .choice { background: #142a3e; color: var(--ink); border-color: #2b4763; }
body:not(.page-admin) .btn-ghost:hover, body:not(.page-admin) .choice:hover { background: #1b354d; }
body:not(.page-admin) .btn.is-picked.btn-ghost, body:not(.page-admin) .choice.is-picked { background: #12361f; border-color: var(--seen); color: #c8f5d6; }
body:not(.page-admin) .btn-danger { background: transparent; color: #ff8a98; border-color: #ff8a98; }
body:not(.page-admin) .chip { background: #142a3e; border-color: #2b4763; color: var(--ink); }
body:not(.page-admin) .chip:has(input:checked) { background: #12361f; border-color: var(--seen); }
body:not(.page-admin) .type-chip { background: #1b3550; color: #dfe8f1; }
.btn-lit { background: #ffc61a; border-color: #e0a800; color: #2b2100; box-shadow: 0 0 14px rgba(255, 198, 26, .4); }
body:not(.page-admin) .fab { background: #102232; color: var(--gold, #ffd76a); border: 1px solid #2b4763; }
body:not(.page-admin) .fab[aria-expanded="true"] { background: var(--red); color: #fff; }
body:not(.page-admin) .map-search input { background: #102232; color: var(--ink); border-color: #2b4763; }
body:not(.page-admin) .map-search input::placeholder { color: #8296ab; }
body:not(.page-admin) .search-results button { color: var(--ink); }
body:not(.page-admin) .search-results button:hover, body:not(.page-admin) .list-item:hover { background: #142a3e; }
body:not(.page-admin) .list-item { color: var(--ink); border-color: #1a3147; }
body:not(.page-admin) .side-head, body:not(.page-admin) .side-foot { border-color: var(--line); }
.status-confirmed { color: var(--gold, #ffd76a) !important; }
.status-reported { color: #ff8a8a; }
.kind-commercial, .kind-public { color: #c9a6ff; }
.owner-badge { background: #12361f; color: #c8f5d6; }
body:not(.page-admin) .tour-stop { background: transparent; border-color: #1a3147; }
body:not(.page-admin) .flash-ok { background: #12361f; color: #c8f5d6; }
body:not(.page-admin) .flash-warn { background: #3a2f0b; color: #ffe9a8; }
body:not(.page-admin) .flash-error { background: #3d1218; color: #ffc2c9; }
body:not(.page-admin) .form-msg { color: #ff9aa6; }
body:not(.page-admin) .form-msg.ok { color: #8fe0a8; }
body:not(.page-admin) code { background: #1b3550; }
body:not(.page-admin) .toast { background: #12263a; border: 1px solid #2b4763; }
body:not(.page-admin) .map-note { background: #12263a; }
.tour-pin span { background: #07121c; border-color: var(--gold, #ffd76a); box-shadow: 0 0 10px rgba(255, 215, 106, .6); }
body:not(.page-admin) .tour-num { background: #07121c; }
.tour-start span { background: var(--red); }
body:not(.page-admin) .site-footer { color: var(--muted); }
/* Form fields stay light for easy reading */
body:not(.page-admin) input[type=text], body:not(.page-admin) input[type=email], body:not(.page-admin) input[type=url],
body:not(.page-admin) input:not([type]), body:not(.page-admin) textarea, body:not(.page-admin) select { background: #f7f9fb; color: #16202b; }

.tour-addr { overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.tour-addr:hover { text-decoration: underline; }

.table tr.row-error td { background: #fdecec; }

/* ---- Pins: lights for homes, ornaments for businesses / public; wreath groups ---- */
.xl-pin svg { display: block; overflow: visible; transition: transform .15s ease-out; transform-origin: 18px 26px; }
.xl-pin-open svg { transform: scale(1.35); }
.xl-pin-inactive { opacity: .5; }
.xl-pin:focus-visible { outline: 2px solid #ffd76a; outline-offset: 2px; border-radius: 6px; }
.xl-cluster svg { display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); }
.list-pin { flex: none; width: 22px; display: flex; justify-content: center; }
.list-pin svg { width: 20px; height: 25px; }
.btn-love.is-loved { color: #ff8fb1; border-color: #ff8fb1; }
.loves-line { color: #ff9fbf; margin: 2px 0; }
.side-head { gap: 8px; }
.list-sort { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 auto; font-weight: 500; color: var(--muted); }
.list-sort select { width: auto; display: inline-block; margin: 0; padding: 4px 8px; font-size: 14px; border-radius: 8px; }
.side-head h2 { white-space: nowrap; font-size: 1.05rem; }
.side-head .btn-small { white-space: nowrap; }
.setting-help { margin: -6px 0 10px; }
.top-list { list-style: none; margin: 0 0 8px; padding: 0; }
.top-list li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.top-item { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; text-align: left; border: 0; background: none; color: inherit; font: inherit; padding: 10px 0; cursor: pointer; }
.top-rank { flex: none; width: 22px; text-align: center; font-family: "Berkshire Swash", Georgia, serif; color: var(--gold, #ffd76a); font-size: 1.15rem; }
.top-item .list-text { display: flex; flex-direction: column; min-width: 0; }
.top-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-add { flex: none; }

/* ---- Installed app (home screen) ---- */
.site-header { padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-left: calc(12px + env(safe-area-inset-left, 0px)); padding-right: calc(12px + env(safe-area-inset-right, 0px)); }

/* ---- Map key ---- */
.legend { display: block; gap: 0; padding: 0; max-width: calc(100% - 80px); }
.legend summary { cursor: pointer; padding: 7px 12px; font-weight: 600; font-size: .85rem; list-style: none; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary::before { content: "▸ "; color: var(--gold, #ffd76a); }
.legend[open] summary::before { content: "▾ "; }
.legend[open] { padding-bottom: 8px; }
.key-group { padding: 2px 12px 4px; }
.key-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 2px; }
.key-row { display: flex; align-items: center; gap: 6px; font-size: .8rem; line-height: 1.6; }
.key-row svg { flex: none; }
.key-pair { display: inline-flex; gap: 1px; width: 32px; flex: none; justify-content: center; }
@media (min-width: 900px) { .legend { bottom: 24px; } }

/* ---- Header: "+ Add" and the site menu ---- */
.site-nav { flex-wrap: nowrap; gap: 8px; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 36px; border-radius: 8px; border: 1px solid #2b4763; background: transparent; color: #eef3f8; cursor: pointer; }
.menu-btn[aria-expanded="true"] { background: #12263a; }
.wide-only { display: none; }
@media (min-width: 700px) { .wide-only { display: inline; } }
.site-menu {
  position: absolute; right: 10px; top: calc(100% + 6px); z-index: 2000; min-width: 240px; max-width: calc(100vw - 20px);
  background: #102232; border: 1px solid #2b4763; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.5); padding: 6px;
}
.site-menu a, .site-menu button { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 8px; color: #eef3f8 !important; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.site-menu a:hover, .site-menu button:hover, .site-menu a:focus-visible, .site-menu button:focus-visible { background: #1b354d; outline: none; }
.site-menu a[aria-current="page"] { color: var(--gold, #ffd76a) !important; }
.site-menu hr { border: 0; border-top: 1px solid #2b4763; margin: 6px 4px; }
.site-menu .menu-install { color: var(--gold, #ffd76a) !important; font-weight: 600; }

/* ---- Admin stats chart (single series, so no legend: the heading names it) ---- */
.viz-root { --surface-1: #fcfcfb; --series-1: #2a78d6; --text-secondary: #52514e; --grid: #e6e8eb; --axis: #b9bec6; }
.bar-chart { width: 100%; height: auto; display: block; background: var(--surface-1); border-radius: 8px; }
.bar-chart .grid { stroke: var(--grid); stroke-width: 1; }
.bar-chart .axis { stroke: var(--axis); stroke-width: 1; }
.bar-chart .tick { font: 11px system-ui, sans-serif; fill: var(--text-secondary); }
.bar-chart .mark { fill: var(--series-1); }
.bar-chart .hit { fill: transparent; }
.bar-chart .bar:hover .hit { fill: rgba(42, 120, 214, .08); }
.bar-chart .bar:hover .mark { fill: #1f63b5; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.home-tip { background: #12263a; border: 1px solid #2b4763; border-radius: 10px; padding: 8px 10px; color: #dfe8f1; }

/* ---- Credits ---- */
.credits { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 18px; }
.credit-tile { flex: 1 1 200px; max-width: 280px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 14px 12px;
  background: #f6f4ef; border-radius: 14px; text-decoration: none; box-shadow: 0 4px 16px rgba(0, 0, 0, .35); transition: transform .15s; }
.credit-tile:hover, .credit-tile:focus-visible { transform: translateY(-2px); }
.credit-tile img { height: 88px; width: auto; max-width: 100%; object-fit: contain; }

.credit-line { margin-top: 6px; opacity: .85; }

/* ---- Town pages and breadcrumbs ---- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 10px 0; }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--muted); }
.crumbs [aria-current] { color: var(--muted); }
.display-page .crumbs { margin: 12px 0 0; }
.town-list { columns: 2 180px; padding-left: 1.1em; }
.town-list li { margin: 4px 0; break-inside: avoid; }
.city-list { list-style: none; padding: 0; }
.city-item h2 { font-size: 1.25rem; margin: 0 0 4px; }
.city-item p { margin: 4px 0; }
.lights-page h1 { font-size: 1.9rem; }
.credit-tile strong { color: #16202b; font-size: 1rem; }
.credit-desc { color: #3b4652 !important; font-size: .88rem !important; font-weight: 400 !important; text-align: center; line-height: 1.4; }
.credit-url { color: #1559b5 !important; font-size: .85rem; font-weight: 600; }
.nav-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: .75rem; text-align: center; }

/* ---- Admin navigation: sections + tabs ---- */
.admin-header { flex-wrap: wrap; }
.admin-nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.admin-nav a, .admin-nav .linkish { color: #dfe8f3; text-decoration: none; padding: 7px 10px; border-radius: 8px; font-size: .95rem; }
.admin-nav a[aria-current="page"] { background: #1b354d; color: #fff; font-weight: 600; }
.admin-nav .nav-quiet { color: #a3b3c4; font-size: .85rem; }
.admin-tabs { display: flex; gap: 4px; padding: 18px 16px 0; max-width: 1100px; margin: 0 auto; overflow-x: auto; border-bottom: 1px solid var(--line); }
.admin-tabs a { white-space: nowrap; padding: 8px 12px; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--muted); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.admin-tabs a[aria-current="page"] { color: var(--ink); background: #fff; border-color: var(--line); font-weight: 600; }
@media (max-width: 700px) {
  .admin-nav { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .admin-nav a { white-space: nowrap; }
}
.attention { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.attention .stat.has-items { border-color: #e5c766; background: #fffaf0; }
.attention .stat.has-items b { color: #8a5a00; }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-section { scroll-margin-top: 12px; }
.email-link { margin-top: 12px; }
.email-link label { margin: 0; }
.email-link .row { margin-top: 6px; }

/* ---- Footer at the bottom of the window on short pages ---- */
body:not(.page-map):not(.page-admin) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:not(.page-map):not(.page-admin) > main { flex: 1 0 auto; width: 100%; }
body:not(.page-map):not(.page-admin) > .site-footer { flex-shrink: 0; }
