:root {
  color-scheme: light;
  --bg: #eef3f0;
  --surface: #ffffff;
  --ink: #17211d;
  --muted: #68766f;
  --line: #d7e0da;
  --green: #256a5f;
  --green-dark: #164b43;
  --green-soft: #dceee9;
  --amber: #c58338;
  --expired-pin: #8f98a1;
  --expired-pin-active: #636b74;
  --blue: #4779a8;
  --shadow: 0 18px 44px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body:not(.legal-page) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "topbar"
    "install"
    "dates"
    "time"
    "map"
    "details"
    "footer";
  width: min(100vw, 440px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: hidden;
  background: #f8faf7;
  box-shadow: 0 0 0 1px rgba(23, 33, 29, 0.06);
}

.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 18px 6px;
  background: rgba(248, 250, 247, 0.94);
}

.brand-block {
  min-width: 0;
}

.brand-block h1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--muted);
  font-weight: 900;
  line-height: 0.95;
  white-space: nowrap;
}

.brand-mark-label {
  font-size: 0.78rem;
}

.brand-mark-version {
  font-size: 0.52rem;
}

.more-menu {
  position: relative;
}

.more-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--green-dark);
  box-shadow: 0 8px 18px rgba(23, 33, 29, 0.08);
}

.more-button[aria-expanded="true"] {
  border-color: var(--green);
  background: var(--green-soft);
}

.more-icon {
  display: flex;
  gap: 2px;
  align-items: center;
}

.more-icon span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.more-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 1000;
  width: min(228px, calc(100vw - 28px));
  max-height: calc(100dvh - 64px);
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(23, 33, 29, 0.16);
}

.more-panel[hidden] {
  display: none;
}

.more-section {
  display: grid;
  gap: 6px;
}

.more-section + .more-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(215, 224, 218, 0.85);
}

.more-section h2 {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.more-link {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  border: 1px solid rgba(30, 123, 103, 0.18);
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 950;
  text-decoration: none;
}

.more-action {
  width: 100%;
  cursor: pointer;
}

.more-link + .more-link {
  margin-top: 6px;
}

.more-link::after {
  content: "↗";
  font-size: 0.78rem;
  line-height: 1;
}

.more-link[href$=".html"]::after {
  content: ">";
}

.more-action::after {
  content: "v";
  font-size: 0.72rem;
  line-height: 1;
}

.more-action[aria-expanded="true"]::after {
  content: "^";
}

.about-panel,
.covered-towns-panel,
.stats-panel,
.install-help-panel,
.terms-panel {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding: 7px;
  border: 1px solid rgba(30, 123, 103, 0.16);
  border-radius: 8px;
  background: #f8fbfa;
}

.about-panel[hidden],
.covered-towns-panel[hidden],
.stats-panel[hidden],
.install-help-panel[hidden],
.terms-panel[hidden] {
  display: none;
}

.about-row {
  display: grid;
  gap: 2px;
}

.about-intro {
  margin: 0;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
}

.about-row span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.about-row strong {
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.25;
}

.terms-section h3,
.install-help-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 950;
}

.terms-section p,
.terms-section ul,
.install-help-section ol {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 0.69rem;
  line-height: 1.35;
}

.terms-section ul {
  padding-left: 15px;
}

.install-help-section ol {
  padding-left: 17px;
}

.terms-section ul li,
.install-help-section ol li {
  margin: 4px 0;
}

.terms-section + .terms-section,
.install-help-section + .install-help-section {
  border-top: 1px solid rgba(215, 224, 218, 0.72);
  padding-top: 6px;
}

.terms-changes {
  margin-bottom: 2px;
}

.covered-towns-panel .town-list {
  max-height: 220px;
}

.stats-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.stats-header strong {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 950;
}

.stats-header span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  white-space: nowrap;
}

.stats-table {
  display: grid;
  gap: 0;
}

.stats-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 52px;
  gap: 6px;
  align-items: baseline;
  min-height: 24px;
  padding: 3px 0;
  border-top: 1px solid rgba(215, 224, 218, 0.72);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.1;
}

.stats-head {
  min-height: 20px;
  border-top: 0;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 950;
  text-transform: uppercase;
}

.stats-row span:last-child {
  justify-self: end;
  font-weight: 950;
}

.stats-status {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.stats-status:empty {
  display: none;
}

.town-list {
  display: grid;
  max-height: 286px;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.town-list-item {
  display: grid;
  gap: 4px;
  padding: 5px 2px;
  border-top: 1px solid rgba(215, 224, 218, 0.75);
}

.town-list-item:first-child {
  border-top: 0;
}

.town-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: baseline;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.15;
}

.town-row strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.town-row span {
  justify-self: end;
  color: var(--muted);
  font-weight: 900;
}

.has-communities .town-row {
  grid-template-columns: minmax(0, 1fr);
}

.town-sublist {
  display: grid;
  gap: 3px;
  margin: 0 0 0 10px;
  padding: 0 0 0 8px;
  border-left: 2px solid rgba(30, 123, 103, 0.22);
  list-style: none;
}

.town-sublist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
}

.town-sublist span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.town-sublist span:last-child {
  justify-self: end;
  font-weight: 850;
}

.town-list-empty {
  padding: 5px 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

h1 {
  margin-top: 0;
  font-size: 1.6rem;
  line-height: 1.05;
}

h2 {
  font-size: 1.28rem;
  line-height: 1.18;
}

.install-prompt {
  grid-area: install;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0 12px 7px;
  padding: 8px;
  border: 1px solid #cbd9d3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.08);
}

.install-prompt[hidden] {
  display: none;
}

.install-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(23, 33, 29, 0.14);
}

.install-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.install-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.install-action,
.install-dismiss {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 950;
  white-space: nowrap;
}

.install-action {
  padding: 0 10px;
  background: var(--green-dark);
  color: white;
}

.install-dismiss {
  padding: 0 8px;
  background: var(--green-soft);
  color: var(--green-dark);
}

.date-strip {
  grid-area: dates;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 12px 4px;
  scrollbar-width: none;
}

.date-strip::-webkit-scrollbar {
  display: none;
}

.date-chip {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 34px;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}

.date-chip span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1;
}

.date-chip strong {
  font-size: 0.74rem;
  line-height: 1;
  white-space: nowrap;
}

.date-chip.is-today {
  min-width: 64px;
}

.date-chip.is-today strong {
  font-size: 0.84rem;
}

.date-chip.is-weekend,
.date-chip.is-holiday {
  border-color: #ead2a0;
  background: #fff1d4;
  color: #3d2f1a;
}

.date-chip.is-holiday {
  border-color: #edc18e;
  background: #ffe5c8;
}

.date-chip.is-weekend span,
.date-chip.is-holiday span {
  color: #8a6331;
}

.date-chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.date-chip.is-active span {
  color: white;
}

.time-filter {
  grid-area: time;
  display: grid;
  gap: 0;
  padding: 0 14px 4px;
  color: var(--ink);
}

.time-filter-top {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 18px;
}

.time-filter-top::before {
  display: none;
}

.time-filter-label {
  color: var(--green-dark);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
}

.time-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: -6px;
}

.time-filter-all-day {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  color: var(--green-dark);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.time-filter-all-day input {
  width: 11px;
  height: 11px;
  margin: 0;
  accent-color: var(--green);
}

.time-filter-all-day input:disabled,
.time-filter-all-day input:disabled + span {
  cursor: default;
  opacity: 0.52;
}
.time-filter-slider {
  --time-start: 0%;
  --time-end: 100%;
  position: relative;
  height: 14px;
}

.time-filter-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 3px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(22, 75, 67, 0.18) 0 var(--time-start),
      var(--green) var(--time-start) var(--time-end),
      rgba(22, 75, 67, 0.18) var(--time-end) 100%
    );
}

.time-filter-slider input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.time-filter-slider input:focus {
  outline: 0;
}

.time-filter-slider input::-webkit-slider-runnable-track {
  height: 3px;
  background: transparent;
  border: 0;
}

.time-filter-slider input::-webkit-slider-thumb {
  width: 23px;
  height: 11px;
  margin-top: -4px;
  border: 1px solid rgba(22, 75, 67, 0.58);
  border-radius: 5px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 2px rgba(37, 106, 95, 0.12),
    0 1px 4px rgba(23, 33, 29, 0.14);
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
}

.time-filter-slider input::-moz-range-track {
  height: 3px;
  background: transparent;
  border: 0;
}

.time-filter-slider input::-moz-range-thumb {
  width: 21px;
  height: 9px;
  border: 1px solid rgba(22, 75, 67, 0.58);
  border-radius: 5px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 2px rgba(37, 106, 95, 0.12),
    0 1px 4px rgba(23, 33, 29, 0.14);
  pointer-events: auto;
}

.time-filter-slider input:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 3px rgba(37, 106, 95, 0.16),
    inset 0 0 0 2px rgba(37, 106, 95, 0.18),
    0 1px 4px rgba(23, 33, 29, 0.14);
}

.time-filter-slider input:focus-visible::-moz-range-thumb {
  box-shadow:
    0 0 0 3px rgba(37, 106, 95, 0.16),
    inset 0 0 0 2px rgba(37, 106, 95, 0.18),
    0 1px 4px rgba(23, 33, 29, 0.14);
}

.event-filter {
  display: block;
  padding: 0;
}

.event-filter-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 112px;
  min-height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f0;
}

.event-filter-button {
  min-width: 0;
  min-height: 22px;
  border: 0;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 29, 0.06);
}

.event-filter-button[data-event-filter="worldCup"] {
  background:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
    url("assets/world-cup-filter-bg.svg") center / cover no-repeat;
}

.event-filter-button.is-active {
  background: var(--green);
  color: white;
  box-shadow: 0 4px 10px rgba(23, 33, 29, 0.1);
}

.event-filter-button[data-event-filter="worldCup"].is-active {
  background: url("assets/world-cup-filter-bg.svg") center / cover no-repeat;
  color: transparent;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.82),
    0 0 0 1px rgba(22, 75, 67, 0.28),
    0 4px 12px rgba(23, 33, 29, 0.16);
}

.map-section {
  grid-area: map;
  padding: 0 14px;
  min-height: 0;
}

.map-surface {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1.4;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #cfd9d4;
  border-radius: 8px;
  background: #dfe8e3;
  box-shadow: var(--shadow);
}

.leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
}

.leaflet-control-attribution {
  font-size: 0.62rem;
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 6px 16px rgba(23, 33, 29, 0.1);
}

.leaflet-control-zoom a {
  border-color: rgba(23, 33, 29, 0.1) !important;
  background: rgba(255, 255, 255, 0.34) !important;
  color: var(--green-dark) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus {
  background: rgba(255, 255, 255, 0.58) !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.locate-button {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 500;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--green-dark);
  box-shadow: 0 5px 13px rgba(23, 33, 29, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.locate-glyph {
  position: relative;
  display: block;
  width: 17px;
  height: 17px;
  background:
    linear-gradient(currentColor, currentColor) center / 2px 17px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 17px 2px no-repeat;
}

.locate-glyph::before {
  position: absolute;
  inset: 2px;
  content: "";
  border: 2px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.locate-glyph::after {
  position: absolute;
  inset: 7px;
  content: "";
  border-radius: 999px;
  background: currentColor;
}

.locate-button.is-loading .locate-glyph {
  animation: pulseLocate 1s ease-in-out infinite;
}

.search-form {
  position: absolute;
  left: 48px;
  top: 8px;
  z-index: 500;
  display: flex;
  height: 32px;
  max-width: calc(100% - 56px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 5px 13px rgba(23, 33, 29, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.search-form input {
  width: 84px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  outline: 0;
  padding: 0 8px;
}

.search-form input::placeholder {
  color: var(--muted);
}

.search-form button {
  min-width: 32px;
  border: 0;
  background: rgba(22, 75, 67, 0.56);
  color: white;
  font-size: 0.72rem;
  font-weight: 950;
  padding: 0 7px;
}

.drive-time-button {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 500;
  min-width: 52px;
  height: 30px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--green-dark);
  font-size: 0.7rem;
  font-weight: 950;
  box-shadow: 0 5px 13px rgba(23, 33, 29, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.drive-time-button.is-active {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(22, 75, 67, 0.62);
  color: white;
}

.drive-time-legend {
  position: absolute;
  left: 66px;
  bottom: 8px;
  z-index: 500;
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 134px);
  padding: 0 7px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 850;
  box-shadow: 0 5px 13px rgba(23, 33, 29, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.drive-time-legend[hidden] {
  display: none;
}

.drive-time-legend span {
  display: flex;
  gap: 3px;
  align-items: center;
  white-space: nowrap;
}

.drive-time-swatch {
  width: 10px;
  height: 5px;
  border-radius: 2px;
}

.drive-time-swatch.is-near {
  background: #56b87a;
}

.drive-time-swatch.is-middle {
  background: #f0b35a;
}

.drive-time-swatch.is-far {
  background: #a28be7;
}

.locate-button:disabled,
.drive-time-button:disabled,
.search-form button:disabled,
.search-form input:disabled {
  cursor: wait;
  opacity: 0.72;
}

@keyframes pulseLocate {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.82);
  }
}

.event-map-marker {
  display: grid;
  width: 26px;
  height: 34px;
  place-items: start center;
  background: transparent;
  backface-visibility: hidden;
  overflow: visible;
  will-change: transform;
}

.event-map-marker::before {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 23px;
  height: 23px;
  content: "";
  border: 2px solid white;
  border-radius: 999px 999px 999px 6px;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(23, 33, 29, 0.22);
  opacity: 0.72;
  backface-visibility: hidden;
  transform: translateX(-50%) rotate(-45deg);
}

.event-map-marker span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: white;
  font-size: 0.68rem;
  font-weight: 950;
}

.event-map-marker.is-active::before {
  width: 29px;
  height: 29px;
  background: var(--amber);
  box-shadow: 0 14px 30px rgba(126, 78, 22, 0.3);
  opacity: 0.86;
}

.event-map-marker.is-active span {
  width: 29px;
  height: 29px;
}

.event-map-marker.is-expired::before {
  background: var(--expired-pin);
  box-shadow: 0 10px 20px rgba(60, 66, 73, 0.22);
}

.event-map-marker.is-expired.is-active::before {
  background: var(--expired-pin-active);
  box-shadow: 0 12px 24px rgba(60, 66, 73, 0.28);
}

.user-location-dot {
  filter: drop-shadow(0 8px 16px rgba(47, 125, 225, 0.3));
  animation: pulseUserDot 1.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes pulseUserDot {
  0%,
  100% {
    opacity: 1;
    stroke-width: 3;
    transform: scale(1);
  }
  50% {
    opacity: 0.76;
    stroke-width: 5;
    transform: scale(1.28);
  }
}

.map-message {
  position: absolute;
  inset: auto 72px 58px 12px;
  z-index: 500;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  box-shadow: 0 10px 26px rgba(23, 33, 29, 0.12);
}

.map-message[hidden] {
  display: none;
}

.map-message strong {
  color: var(--ink);
}

.map-empty {
  position: absolute;
  inset: 20px;
  z-index: 3;
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1px dashed rgba(23, 33, 29, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  text-align: center;
}

.map-empty strong {
  color: var(--ink);
}

.event-detail {
  grid-area: details;
  margin: 6px 14px 10px;
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.detail-group {
  display: grid;
  gap: 7px;
  padding: 10px 11px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(23, 33, 29, 0.08);
}

.detail-group + .detail-group {
  margin-top: 0;
}

.detail-group.is-active {
  border-color: rgba(197, 131, 56, 0.7);
}

.detail-group.is-active .pin-badge {
  background: var(--amber);
  box-shadow: 0 8px 18px rgba(126, 78, 22, 0.28);
}

.place-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "pin place directions";
  gap: 5px 7px;
  align-items: center;
}

.place-line.has-no-pin {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "place directions";
}

.pin-badge {
  grid-area: pin;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(23, 91, 79, 0.24);
}

.pin-badge.is-expired {
  background: var(--expired-pin);
  box-shadow: 0 8px 18px rgba(60, 66, 73, 0.22);
}

.detail-group.is-active .pin-badge.is-expired {
  background: var(--expired-pin-active);
  box-shadow: 0 8px 18px rgba(60, 66, 73, 0.28);
}

.place-name {
  grid-area: place;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directions-link {
  grid-area: directions;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
}

.directions-link.is-disabled {
  background: #e7e5e4;
  color: #8a8580;
  cursor: not-allowed;
}

.detail-events {
  display: grid;
  gap: 8px;
  margin-top: 1px;
}

.detail-event {
  display: grid;
  gap: 4px;
}

.detail-event + .detail-event {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.detail-event h2 {
  font-size: 1rem;
  line-height: 1.18;
}

.event-disclosure {
  display: grid;
  gap: 4px;
}

.event-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.18;
  list-style: none;
  width: 100%;
  cursor: pointer;
}

.event-time::-webkit-details-marker {
  display: none;
}

.event-disclosure-cue {
  color: #5f746d;
  font-size: 0.74rem;
  letter-spacing: 0;
  transform: translateY(-0.5px);
}

.event-disclosure[open] .event-disclosure-cue {
  color: var(--green-dark);
}

.event-disclosure-body {
  display: grid;
  gap: 4px;
}

.event-summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.event-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  width: fit-content;
  padding: 0 9px;
  border: 1px solid rgba(37, 106, 95, 0.28);
  border-radius: 7px;
  background: #edf7f3;
  color: var(--green-dark);
  font-size: 0.7rem;
  font-weight: 900;
  text-decoration: none;
}

.event-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.event-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 23px;
  padding: 0 7px;
  border: 1px solid rgba(22, 75, 67, 0.16);
  border-radius: 7px;
  background: #fff;
  color: var(--green-dark);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
}

.event-action-report {
  min-height: 23px;
  padding: 0 7px;
  border-color: rgba(91, 111, 106, 0.2);
  background: #f7f9f8;
  color: #667772;
  font-weight: 850;
}

.event-action-report:hover {
  border-color: rgba(37, 106, 95, 0.28);
  background: #f1f6f4;
  color: #36564f;
  text-decoration: none;
}

.event-action-like {
  min-width: 42px;
}

.event-like-icon {
  width: 13px;
  height: 13px;
  color: #d94a4a;
  fill: currentColor;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 2;
  flex: 0 0 auto;
}

.event-action-like[aria-pressed="false"] .event-like-icon {
  fill: none;
}

.event-action-like[aria-pressed="true"] .event-like-icon {
  color: #d94a4a;
}

.event-action-like.is-liked {
  border-color: rgba(197, 131, 56, 0.38);
  background: #fff7e8;
  color: #9a5a14;
}

.event-action:disabled {
  cursor: default;
  opacity: 0.52;
}

.empty-detail {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.empty-detail strong {
  color: var(--ink);
}

.site-footer {
  grid-area: footer;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 3px 8px 4px;
  border-top: 1px solid rgba(215, 224, 218, 0.72);
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.site-footer a {
  color: var(--green-dark);
  font-weight: 950;
  text-decoration: none;
}

.site-footer-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-size: 0.56rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 14px;
}

.terms-modal[hidden] {
  display: none;
}

.feedback-modal[hidden] {
  display: none;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: end center;
  padding: 16px 12px;
}

.feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(23, 33, 29, 0.32);
}

.feedback-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  width: min(100%, 390px);
  max-height: min(86vh, 560px);
  overflow: auto;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(23, 33, 29, 0.22);
}

.feedback-modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.feedback-modal-header h2 {
  font-size: 1rem;
  line-height: 1.15;
}

.feedback-modal-header p {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-modal-close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(22, 75, 67, 0.14);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 950;
}

.feedback-form {
  display: grid;
  gap: 10px;
}

.feedback-form fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.feedback-form legend,
.feedback-notes-label {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.feedback-form legend {
  margin-bottom: 7px;
}

.feedback-form label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.feedback-form input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--green);
}

.feedback-form textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid rgba(22, 75, 67, 0.16);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  padding: 8px;
}

.feedback-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-cancel,
.feedback-submit {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 950;
}

.feedback-cancel {
  border: 1px solid rgba(22, 75, 67, 0.14);
  background: #fff;
  color: var(--green-dark);
}

.feedback-submit {
  border: 0;
  background: var(--green);
  color: #fff;
}

.feedback-submit:disabled {
  opacity: 0.52;
}

.terms-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(18, 24, 23, 0.44);
}

.terms-modal-panel {
  position: relative;
  width: min(100%, 700px);
  max-height: 82vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.terms-modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.terms-modal-header h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 950;
}

.terms-modal-close {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--green-dark);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 950;
}

.terms-modal-content {
  max-height: 72vh;
  overflow: auto;
  padding: 8px 12px 12px;
  display: grid;
  gap: 8px;
}

body.modal-open {
  overflow: hidden;
}

.legal-page {
  min-height: 100vh;
  padding: 20px 14px;
}

.legal-shell {
  display: grid;
  gap: 18px;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-header {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.legal-header h1 {
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.03;
}

.legal-header p,
.legal-section p,
.legal-section li,
.legal-footer {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.legal-section {
  display: grid;
  gap: 8px;
}

.legal-section h2 {
  font-size: 1rem;
  line-height: 1.15;
}

.legal-section ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.legal-footer {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.legal-back {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--green-dark);
  color: white;
  font-size: 0.84rem;
  font-weight: 950;
  text-decoration: none;
}

@media (min-width: 700px) {
  body {
    padding: 20px 0;
  }

  .app-shell {
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
    min-height: 0;
    border-radius: 8px;
  }
}

@media (max-width: 380px) {
  .install-prompt {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .install-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}
