@import url("https://use.typekit.net/dfj4eiq.css");
@import url("https://fonts.googleapis.com/css2?family=Niramit:wght@400;500;600;700;800&display=swap");

:root {
  /* Fonts */
  --font-body: "sofia-pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Niramit", "sofia-pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --font-weight-regular: 400;
  --font-weight-bold: 700;

  /* Amplify Utah Brand Colors */
  --amplify-teal: #0092A0;
  --amplify-teal-dark: #007682;
  --amplify-teal-deep: #075D68;
  --amplify-teal-soft: #CDE8EB;

  --amplify-orange: #FF9B00;
  --amplify-orange-dark: #E88C00;
  --amplify-orange-soft: #FFF1D8;

  --amplify-purple: #B44B9B;
  --amplify-purple-dark: #963B80;
  --amplify-purple-soft: #F5E3F1;

  --amplify-blue: #46657C;
  --amplify-blue-dark: #334B5E;
  --amplify-blue-soft: #E5EDF2;

  --amplify-gray: #70838C;
  --amplify-text: rgb(88, 92, 95);
  --amplify-navy: #172433;
  --amplify-cream: #FFF8F3;
  --amplify-white: #FFFFFF;
  --amplify-black: #111111;

  /* Page Theme */
  --page-bg: var(--amplify-cream);
  --page-bg-secondary: #FFF3EA;

  --text-main: var(--amplify-navy);
  --text-body: var(--amplify-text);
  --text-muted: rgba(88, 92, 95, 0.72);
  --text-soft: rgba(88, 92, 95, 0.52);
  --text-inverse: #FFFFFF;

  /* Type Scale */
  --body-font-size: 18px;
  --body-line-height: 27px;
  --body-font-weight: 400;

  --button-font-size: 20px;
  --button-line-height: 30px;
  --button-font-weight: 700;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-4xl: 44px;
  --text-5xl: 58px;

  --line-tight: 1.1;
  --line-sm: 1.25;
  --line-md: 1.5;
  --line-lg: 1.65;

  /* Surfaces */
  --surface-white: #FFFFFF;
  --surface-glass: rgba(255, 255, 255, 0.86);
  --surface-glass-strong: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(255, 248, 243, 0.82);
  --surface-teal: var(--amplify-teal-soft);
  --surface-blue: var(--amplify-blue-soft);
  --surface-orange: var(--amplify-orange-soft);
  --surface-purple: var(--amplify-purple-soft);

  /* Cards */
  --card-bg: var(--surface-glass);
  --card-bg-strong: var(--surface-glass-strong);
  --card-border: rgba(70, 101, 124, 0.18);

  /* Borders */
  --border-light: rgba(70, 101, 124, 0.14);
  --border-medium: rgba(70, 101, 124, 0.22);
  --border-strong: rgba(70, 101, 124, 0.34);
  --border-white: rgba(255, 255, 255, 0.42);

  /* Inputs */
  --input-bg: rgba(255, 255, 255, 0.78);
  --input-bg-hover: rgba(255, 255, 255, 0.92);
  --input-bg-focus: #FFFFFF;
  --input-border: rgba(70, 101, 124, 0.18);
  --input-border-hover: rgba(0, 146, 160, 0.42);
  --input-placeholder: rgba(88, 92, 95, 0.5);
  --focus-ring: rgba(0, 146, 160, 0.18);

  /* Buttons */
  --button-bg: var(--amplify-blue);
  --button-bg-hover: var(--amplify-teal);
  --button-text: #FFFFFF;
  --button-radius: 14px;

  /* Status Colors */
  --success: #1F9D66;
  --success-bg: rgba(31, 157, 102, 0.1);
  --success-border: rgba(31, 157, 102, 0.24);

  --warning: #FF9B00;
  --warning-bg: rgba(255, 155, 0, 0.12);
  --warning-border: rgba(255, 155, 0, 0.28);

  --error: #B7352F;
  --error-bg: rgba(255, 69, 58, 0.09);
  --error-border: rgba(255, 69, 58, 0.24);

  --info: #0092A0;
  --info-bg: rgba(0, 146, 160, 0.1);
  --info-border: rgba(0, 146, 160, 0.24);

  /* Shadows */
  --shadow-xs: 0 2px 6px rgba(23, 36, 51, 0.06);
  --shadow-sm: 0 8px 22px rgba(23, 36, 51, 0.08);
  --shadow-md: 0 16px 38px rgba(23, 36, 51, 0.12);
  --shadow-lg: 0 28px 70px rgba(23, 36, 51, 0.14);
  --shadow-xl: 0 34px 90px rgba(23, 36, 51, 0.18);

  --shadow-teal: 0 18px 34px rgba(0, 146, 160, 0.26);
  --shadow-orange: 0 18px 34px rgba(255, 155, 0, 0.3);
  --shadow-blue: 0 14px 28px rgba(70, 101, 124, 0.28);

  /* Radius */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-pill: 999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Motion */
  --transition-fast: 0.16s ease;
  --transition-normal: 0.22s ease;
  --transition-slow: 0.35s ease;
}

/* Night theme controlled by your JS */
html.theme-night {
  --page-bg: #111C28;
  --page-bg-secondary: #173345;

  --text-main: #FFFFFF;
  --text-body: rgba(255, 255, 255, 0.78);
  --text-muted: rgba(255, 255, 255, 0.58);
  --text-soft: rgba(255, 255, 255, 0.42);
  --text-inverse: #111111;

  --surface-glass: rgba(18, 30, 42, 0.82);
  --surface-glass-strong: rgba(22, 38, 52, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.08);

  --card-bg: var(--surface-glass);
  --card-bg-strong: var(--surface-glass-strong);
  --card-border: rgba(205, 232, 235, 0.16);

  --border-light: rgba(255, 255, 255, 0.12);
  --border-medium: rgba(205, 232, 235, 0.18);
  --border-strong: rgba(205, 232, 235, 0.3);

  --input-bg: rgba(255, 255, 255, 0.1);
  --input-bg-hover: rgba(255, 255, 255, 0.14);
  --input-bg-focus: rgba(255, 255, 255, 0.17);
  --input-border: rgba(255, 255, 255, 0.14);
  --input-border-hover: rgba(205, 232, 235, 0.38);
  --input-placeholder: rgba(255, 255, 255, 0.48);
  --focus-ring: rgba(0, 146, 160, 0.3);

  --shadow-xs: 0 2px 6px rgba(0, 0, 0, 0.16);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 16px 38px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.38);
  --shadow-xl: 0 38px 100px rgba(0, 0, 0, 0.48);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--body-font-size);
  line-height: var(--body-line-height);
  font-weight: var(--body-font-weight);
  color: var(--text-body);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--amplify-blue);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--amplify-teal);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-main);
  letter-spacing: -0.035em;
}

p {
  margin: 0;
}

.text-body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 27px;
  font-weight: 400;
  color: var(--text-body);
}

.text-muted {
  color: var(--text-muted);
}

.text-soft {
  color: var(--text-soft);
}

.text-button {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 30px;
  font-weight: 700;
  color: #FFFFFF;
}

/* Buttons */
.btn,
.button,
.login-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--button-radius);
  font-family: var(--font-body);
  font-size: var(--button-font-size);
  line-height: var(--button-line-height);
  font-weight: var(--button-font-weight);
  color: var(--button-text);
  background: var(--button-bg);
  box-shadow: var(--shadow-blue);
  cursor: pointer;
  transition:
    transform var(--transition-normal),
    background var(--transition-normal),
    box-shadow var(--transition-normal),
    border-color var(--transition-normal),
    color var(--transition-normal);
}

.btn:hover,
.button:hover,
.login-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
  color: var(--button-text);
  background: var(--button-bg-hover);
  box-shadow: var(--shadow-teal);
}

.btn:active,
.button:active,
.login-button:active,
.primary-button:active {
  transform: translateY(0) scale(0.985);
}

.btn-orange {
  color: #111111;
  background: var(--amplify-orange);
  box-shadow: var(--shadow-orange);
}

.btn-orange:hover {
  color: #111111;
  background: var(--amplify-orange-dark);
  box-shadow: var(--shadow-orange);
}

.btn-teal {
  color: #FFFFFF;
  background: var(--amplify-teal);
  box-shadow: var(--shadow-teal);
}

.btn-teal:hover {
  color: #FFFFFF;
  background: var(--amplify-teal-dark);
}

.btn-purple {
  color: #FFFFFF;
  background: var(--amplify-purple);
}

.btn-purple:hover {
  color: #FFFFFF;
  background: var(--amplify-purple-dark);
}

.btn-ghost {
  color: var(--amplify-blue);
  background: transparent;
  border: 1px solid var(--border-medium);
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--amplify-teal);
  background: var(--surface-soft);
  box-shadow: none;
}

.btn-small {
  min-height: 42px;
  padding: 8px 16px;
  font-size: 16px;
  line-height: 24px;
}

.btn-full {
  width: 100%;
}

/* Inputs */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 26px;
  font-weight: 400;
  color: var(--text-main);
  background: var(--input-bg);
  box-shadow: var(--shadow-xs);
  outline: none;
  transition:
    border-color var(--transition-normal),
    background var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-normal);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
select {
  height: 50px;
  padding: 0 15px;
}

textarea {
  min-height: 120px;
  padding: 14px 15px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
  font-weight: 400;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--input-border-hover);
  background: var(--input-bg-hover);
}

input:focus,
textarea:focus,
select:focus {
  background: var(--input-bg-focus);
  border-color: rgba(0, 146, 160, 0.55);
  box-shadow: 0 0 0 4px var(--focus-ring), var(--shadow-xs);
}

input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

/* Labels */
.input-label,
label {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  color: var(--amplify-blue);
}

html.theme-night .input-label,
html.theme-night label {
  color: rgba(255, 255, 255, 0.76);
}

/* Cards */
.card,
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: saturate(170%) blur(24px);
  -webkit-backdrop-filter: saturate(170%) blur(24px);
}

.card-strong {
  background: var(--card-bg-strong);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.card-flat {
  background: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

/* Alerts */
.alert,
.error-message,
.success-message,
.warning-message,
.info-message {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 22px;
  font-weight: 400;
}

.error-message {
  border: 1px solid var(--error-border);
  background: var(--error-bg);
  color: var(--error);
}

.success-message {
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

.warning-message {
  border: 1px solid var(--warning-border);
  background: var(--warning-bg);
  color: #9B5B00;
}

.info-message {
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info);
}

/* Pills / Badges */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.badge-teal {
  color: var(--amplify-teal-dark);
  background: var(--amplify-teal-soft);
}

.badge-orange {
  color: #8A5100;
  background: var(--amplify-orange-soft);
}

.badge-purple {
  color: var(--amplify-purple);
  background: var(--amplify-purple-soft);
}

.badge-blue {
  color: var(--amplify-blue);
  background: var(--amplify-blue-soft);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  color: var(--amplify-blue);
}

td {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 22px;
  color: var(--text-body);
}

tr:last-child td {
  border-bottom: none;
}

/* Layout Helpers */
.page-shell {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
}

.page-section {
  padding: var(--space-12) 0;
}

.stack {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wrap {
  flex-wrap: wrap;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-5 {
  gap: var(--space-5);
}

.gap-6 {
  gap: var(--space-6);
}

.hidden {
  display: none !important;
}

.full-width {
  width: 100%;
}

.rounded {
  border-radius: var(--radius-lg);
}

.shadow {
  box-shadow: var(--shadow-md);
}

.no-scroll {
  overflow: hidden;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Brand Background Utility */
.amplify-brand-bg {
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 155, 0, 0.9) 0 8%, transparent 20%),
    radial-gradient(circle at 74% 58%, rgba(205, 232, 235, 1) 0 30%, transparent 58%),
    radial-gradient(circle at 15% 78%, rgba(0, 146, 160, 0.2) 0 20%, transparent 42%),
    radial-gradient(circle at 78% 86%, rgba(180, 75, 155, 0.22) 0 14%, transparent 34%),
    linear-gradient(135deg, #FFF8F3 0%, #FFF3EA 40%, #EAF7F8 72%, #CDE8EB 100%);
}

html.theme-night .amplify-brand-bg {
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 155, 0, 0.72) 0 8%, transparent 22%),
    radial-gradient(circle at 72% 60%, rgba(0, 146, 160, 0.38) 0 30%, transparent 60%),
    radial-gradient(circle at 18% 76%, rgba(180, 75, 155, 0.3) 0 18%, transparent 42%),
    linear-gradient(135deg, #111C28 0%, #173345 46%, #075D68 100%);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softFloat {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(12px, -14px, 0);
  }
}

@keyframes softPulse {
  from {
    opacity: 0.72;
    transform: scale(1);
  }

  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

.animate-fade-up {
  animation: fadeUp 0.45s ease both;
}

.animate-float {
  animation: softFloat 16s ease-in-out infinite alternate;
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --body-font-size: 16px;
    --body-line-height: 24px;
    --button-font-size: 18px;
    --button-line-height: 27px;
  }

  .page-shell {
    width: min(100% - 28px, 1180px);
  }

  .page-section {
    padding: var(--space-8) 0;
  }

  .btn,
  .button,
  .login-button,
  .primary-button {
    min-height: 52px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="time"],
  select {
    height: 50px;
    font-size: 16px;
    line-height: 24px;
  }

  textarea {
    font-size: 16px;
    line-height: 24px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Logo day/night swap (used by the navbar include) */
.logo-night {
  display: none;
}

html.theme-night .logo-day {
  display: none;
}

html.theme-night .logo-night {
  display: inline-block;
}

/* =====================================================================
   AMPLIFY UTAH — PUBLIC PHOTO MAP
   /assets/styles/map-styles.css   (served via styles.php?page=map)

   App-style full-viewport page: browse panel left, map right.
   Built entirely on theme.css custom properties. Raw values are the
   usual pair (#FFFFFF / #111111) plus rgba() washes from brand RGB
   triplets theme.css already uses. Hovers use --info-bg.
   ===================================================================== */

/* ---------------------------------------------------------------
   Shared public primitives
   --------------------------------------------------------------- */
.pub-body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text-body);
    font-family: var(--font-body);
}

.mp-body { overflow: hidden; }               /* the panel scrolls, not the page */

.pub-protected,
.pub-protected img {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

.pub-eyebrow {
    display: inline-flex;
    align-items: center;
    margin: 0 0 var(--space-3);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    color: var(--amplify-teal-dark);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

html.theme-night .pub-eyebrow { color: var(--amplify-teal-soft); }

.pub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 54px;
    padding: 12px 22px;
    border: none;
    border-radius: var(--button-radius);
    font-family: var(--font-body);
    font-size: var(--button-font-size);
    line-height: var(--button-line-height);
    font-weight: var(--button-font-weight);
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition-normal), background var(--transition-normal),
                box-shadow var(--transition-normal), color var(--transition-normal);
}

.pub-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.pub-btn i { font-size: 0.8em; }
.pub-btn-small { min-height: 44px; padding: 8px 18px; font-size: var(--text-md); line-height: 24px; }

.pub-btn-teal {
    color: #FFFFFF !important;
    background: var(--amplify-teal);
    box-shadow: var(--shadow-teal);
}
.pub-btn-teal:hover { transform: translateY(-2px); background: var(--amplify-teal-dark); }

/* ---------------------------------------------------------------
   Layout: fixed navbar (76px) → app frame below
   --------------------------------------------------------------- */
.mp-main {
    position: fixed;
    inset: 76px 0 0 0;
}

.mp-layout {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    height: 100%;
}

/* ---------------------------------------------------------------
   Browse panel
   --------------------------------------------------------------- */
.mp-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--border-light);
    background: var(--card-bg-strong);
    backdrop-filter: saturate(170%) blur(24px);
    -webkit-backdrop-filter: saturate(170%) blur(24px);
    z-index: 900;
}

.mp-side-head { padding: var(--space-6) var(--space-6) var(--space-4); }

.mp-h1 {
    margin: 0 0 var(--space-2);
    font-family: var(--font-display);
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: var(--line-tight);
    color: var(--text-main);
}

.mp-sub {
    margin: 0 0 var(--space-4);
    font-size: var(--text-sm);
    line-height: var(--line-lg);
    color: var(--text-muted);
}

.mp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    margin: 0;
    padding: 0;
}

.mp-stat {
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    text-align: center;
}

.mp-stat dd {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: var(--line-tight);
    color: var(--amplify-teal-dark);
    font-variant-numeric: tabular-nums;
}

html.theme-night .mp-stat dd { color: var(--amplify-teal-soft); }

.mp-stat-of { font-size: 0.6em; font-weight: 700; color: var(--text-soft); }

.mp-stat dt {
    margin-top: 2px;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-soft);
}

/* ---- Tools: search + county chips ---- */
.mp-tools {
    padding: 0 var(--space-6) var(--space-3);
    border-bottom: 1px solid var(--border-light);
}

.mp-search {
    position: relative;
    margin-bottom: var(--space-3);
}

.mp-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    font-size: 13px;
    pointer-events: none;
}

.mp-search input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: var(--font-body);
    box-shadow: var(--shadow-xs);
}

.mp-search input::placeholder { color: var(--input-placeholder); }
.mp-search input:hover { border-color: var(--input-border-hover); background: var(--input-bg-hover); }
.mp-search input:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }

.mp-chips {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, rgba(255,255,255,1) 92%, transparent);
    mask-image: linear-gradient(90deg, rgba(255,255,255,1) 92%, transparent);
    padding-right: var(--space-5);
}

.mp-chips::-webkit-scrollbar { display: none; }

.mp-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    min-height: 32px;
    padding: 4px 13px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-pill);
    background: var(--card-bg);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), background var(--transition-fast),
                border-color var(--transition-fast);
}

.mp-chip:hover {
    color: var(--amplify-teal);
    background: var(--info-bg);
    border-color: var(--info-border);
}

.mp-chip:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.mp-chip.is-on {
    color: #FFFFFF !important;
    background: var(--amplify-teal);
    border-color: var(--amplify-teal);
}

.mp-chip-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 3px 6px;
    border-radius: var(--radius-pill);
    background: var(--info-bg);
    color: var(--amplify-teal-dark);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

html.theme-night .mp-chip-n { color: var(--amplify-teal-soft); }

.mp-chip.is-on .mp-chip-n {
    background: rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
}

/* ---- Event list ---- */
.mp-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    scrollbar-width: thin;
}

.mp-list::-webkit-scrollbar { width: 6px; }
.mp-list::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: var(--radius-pill); }

.mp-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    text-align: left;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.mp-card:hover {
    background: var(--info-bg);
    border-color: var(--info-border);
}

.mp-card:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }

.mp-card-thumb {
    flex-shrink: 0;
    width: 58px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--surface-soft);
}

.mp-card-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--text-soft);
    font-size: 14px;
}

.mp-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }

.mp-card-title {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-sm);
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-card-meta {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-card-n {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    background: var(--info-bg);
    color: var(--amplify-teal-dark);
    font-size: 11.5px;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

html.theme-night .mp-card-n { color: var(--amplify-teal-soft); }

.mp-list-empty {
    margin: var(--space-6);
    padding: var(--space-5);
    border: 1.5px dashed var(--border-medium);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: var(--text-sm);
    line-height: var(--line-md);
    color: var(--text-muted);
}

.mp-list-empty i { display: block; margin-bottom: var(--space-2); color: var(--amplify-teal); font-size: 18px; }

.mp-side-foot {
    padding: var(--space-3) var(--space-6);
    border-top: 1px solid var(--border-light);
    font-size: var(--text-xs);
    color: var(--text-soft);
}

.mp-side-foot a { color: var(--text-muted); text-decoration: none; }
.mp-side-foot a:hover { color: var(--amplify-teal); }

.mp-staff { margin-left: var(--space-2); opacity: 0.55; }
.mp-staff:hover { opacity: 1; }

/* ---------------------------------------------------------------
   Map area
   --------------------------------------------------------------- */
.mp-map-wrap { position: relative; min-width: 0; }

.mp-map {
    position: absolute;
    inset: 0;
    background: var(--surface-soft);
}

.mp-map .leaflet-container { font-family: var(--font-body); background: var(--surface-soft); }

/* ---- Floating view-mode switch ---- */
.mp-mode {
    position: absolute;
    top: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    display: flex;
    padding: 4px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    background: var(--card-bg-strong);
    backdrop-filter: saturate(170%) blur(24px);
    -webkit-backdrop-filter: saturate(170%) blur(24px);
    box-shadow: var(--shadow-md);
}

.mp-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 6px 15px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    line-height: 1;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.mp-mode-btn i { font-size: 12px; }
.mp-mode-btn:hover { color: var(--amplify-teal); background: var(--info-bg); }
.mp-mode-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.mp-mode-btn.is-on {
    color: #FFFFFF !important;
    background: var(--amplify-teal);
    box-shadow: var(--shadow-teal);
}

/* ---- Corner controls ---- */
.mp-controls {
    position: absolute;
    right: var(--space-4);
    bottom: calc(var(--space-4) + 28px);
    z-index: 800;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.mp-ctrl {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: var(--card-bg-strong);
    backdrop-filter: saturate(170%) blur(24px);
    -webkit-backdrop-filter: saturate(170%) blur(24px);
    color: var(--text-body);
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: color var(--transition-fast), background var(--transition-fast),
                border-color var(--transition-fast);
}

.mp-ctrl:hover {
    color: var(--amplify-teal);
    background: var(--info-bg);
    border-color: var(--info-border);
}

.mp-ctrl:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.mp-ctrl.is-on {
    color: #FFFFFF;
    background: var(--amplify-teal);
    border-color: var(--amplify-teal);
    box-shadow: var(--shadow-teal);
}

/* ---- Toast ---- */
.mp-toast {
    position: absolute;
    left: 50%;
    bottom: calc(var(--space-4) + 66px);
    transform: translate(-50%, 8px);
    z-index: 950;
    max-width: min(320px, calc(100% - 32px));
    padding: 10px 18px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    background: var(--amplify-navy);
    color: #FFFFFF;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--transition-normal), transform var(--transition-normal),
                visibility var(--transition-normal);
}

.mp-toast.is-show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ---- Heat legend ---- */
.mp-legend {
    position: absolute;
    left: var(--space-4);
    bottom: var(--space-4);
    z-index: 800;
    width: 190px;
    padding: var(--space-3);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--card-bg-strong);
    backdrop-filter: saturate(170%) blur(24px);
    -webkit-backdrop-filter: saturate(170%) blur(24px);
    box-shadow: var(--shadow-sm);
}

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

.mp-legend-bar {
    display: block;
    height: 8px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--amplify-blue), var(--amplify-teal), var(--amplify-orange));
    margin-bottom: 6px;
}

.mp-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-soft);
}

/* ---- Empty state ---- */
.mp-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 800;
    transform: translate(-50%, -50%);
    width: min(360px, calc(100% - 40px));
    padding: var(--space-6);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    background: var(--card-bg-strong);
    backdrop-filter: saturate(170%) blur(24px);
    -webkit-backdrop-filter: saturate(170%) blur(24px);
    box-shadow: var(--shadow-md);
    text-align: center;
    color: var(--text-body);
    font-size: var(--text-sm);
    line-height: var(--line-md);
}

.mp-empty i {
    display: block;
    margin: 0 auto var(--space-3);
    font-size: 26px;
    color: var(--amplify-teal);
}

.mp-empty strong { color: var(--text-main); }
.mp-empty .pub-btn { margin-top: var(--space-4); }

/* ---------------------------------------------------------------
   Pins, clusters, popups, you-dot
   --------------------------------------------------------------- */
.mp-pin {
    position: relative;
    width: 46px;
    height: 56px;
    filter: drop-shadow(0 6px 12px rgba(23, 36, 51, 0.4));
    animation: mp-pin-in 0.4s cubic-bezier(0.2, 0.7, 0.3, 1.25) both;
}

@keyframes mp-pin-in {
    0%   { opacity: 0; transform: translateY(-14px) scale(0.55); }
    65%  { opacity: 1; transform: translateY(2px)  scale(1.06); }
    100% { opacity: 1; transform: translateY(0)    scale(1); }
}

.mp-pin-tail {
    position: absolute;
    left: 50%;
    top: 37px;
    z-index: 0;
    width: 12px;
    height: 12px;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 2.5px;
    background: var(--amplify-white);
}

.mp-pin-circle {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 2.5px solid var(--amplify-white);
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--amplify-teal), var(--amplify-teal-deep));
    color: #FFFFFF;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.mp-pin-circle i { font-size: 15px; }

/* Photo as a background layer over the camera icon: a dead URL simply
   doesn't paint, so the icon shows — no broken-image glyph, ever. */
.mp-pin-photo {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.mp-pin:hover .mp-pin-circle {
    transform: scale(1.09);
    box-shadow: 0 0 0 5px rgba(0, 146, 160, 0.28);
}

/* Pulse while its popup is open */
.mp-pin.is-focus .mp-pin-circle {
    animation: mp-pin-pulse 1.6s ease-out infinite;
}

@keyframes mp-pin-pulse {
    0%   { box-shadow: 0 0 0 0    rgba(0, 146, 160, 0.45); }
    70%  { box-shadow: 0 0 0 14px rgba(0, 146, 160, 0);    }
    100% { box-shadow: 0 0 0 0    rgba(0, 146, 160, 0);    }
}

.mp-pin-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 2px solid var(--amplify-white);
    border-radius: var(--radius-pill);
    background: var(--amplify-orange);
    color: #111111;
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* ---- Clusters ---- */
.mp-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 2.5px solid var(--amplify-white);
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--amplify-teal), var(--amplify-teal-deep));
    color: #FFFFFF;
    box-shadow: var(--shadow-teal);
    transition: transform var(--transition-fast);
}

.mp-cluster:hover { transform: scale(1.06); }

.mp-cluster-md { background: linear-gradient(135deg, var(--amplify-teal-dark), var(--amplify-teal-deep)); }
.mp-cluster-lg { background: linear-gradient(135deg, var(--amplify-teal-deep), var(--amplify-navy)); }

.mp-cluster-count {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.mp-cluster-lg .mp-cluster-count { font-size: 20px; }

.mp-cluster-sub {
    font-size: 8.5px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    opacity: 0.85;
    white-space: nowrap;
}

/* ---- Popups ---- */
.mp-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: var(--radius-lg);
    background: var(--card-bg-strong);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.mp-popup .leaflet-popup-content { margin: 0; width: 250px !important; }
.mp-popup .leaflet-popup-tip { background: var(--card-bg-strong); }

.mp-popup .leaflet-popup-close-button {
    top: 8px !important;
    right: 8px !important;
    width: 26px !important;
    height: 26px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: var(--radius-pill) !important;
    color: #FFFFFF !important;
    background: rgba(23, 36, 51, 0.55) !important;
    font: 17px/1 var(--font-body) !important;
    transition: background var(--transition-fast);
}

.mp-popup .leaflet-popup-close-button:hover { background: rgba(23, 36, 51, 0.78) !important; }

.mp-popup-thumb {
    width: 100%;
    height: 132px;
    object-fit: cover;
    display: block;
    background: var(--surface-soft);
}

.mp-popup-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--text-soft);
    font-size: 22px;
}

.mp-popup-body { padding: var(--space-3) var(--space-4) var(--space-4); }

.mp-popup-title {
    margin-bottom: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    line-height: var(--line-sm);
    color: var(--text-main);
}

.mp-popup-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
}

.mp-popup-meta i { color: var(--amplify-teal); font-size: 10.5px; }

.mp-popup-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.mp-popup-copy {
    flex-shrink: 0;
    width: 38px;
    min-height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast),
                border-color var(--transition-fast);
}

.mp-popup-copy:hover {
    color: var(--amplify-teal);
    background: var(--info-bg);
    border-color: var(--info-border);
}

.mp-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    flex: 1;
    min-height: 38px;
    border-radius: var(--radius-sm);
    background: var(--amplify-teal);
    color: #FFFFFF !important;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.mp-popup-btn:hover { background: var(--amplify-teal-dark); }
.mp-popup-btn i { font-size: 11px; }

/* ---- Geolocation dot ---- */
.mp-you {
    width: 18px;
    height: 18px;
    border: 3px solid var(--amplify-white);
    border-radius: var(--radius-pill);
    background: var(--amplify-blue);
    box-shadow: 0 0 0 6px rgba(70, 101, 124, 0.25);
}

/* ---- Attribution pill ---- */
.mp-map .leaflet-control-attribution {
    margin: 0 8px 8px 0 !important;
    padding: 3px 11px !important;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    background: var(--card-bg-strong) !important;
    backdrop-filter: saturate(170%) blur(24px);
    -webkit-backdrop-filter: saturate(170%) blur(24px);
    box-shadow: var(--shadow-xs);
    color: var(--text-soft) !important;
    font-family: var(--font-body) !important;
    font-size: 10px !important;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.3px;
}

.mp-map .leaflet-control-attribution a {
    color: var(--text-muted) !important;
    text-decoration: none !important;
}

.mp-map .leaflet-control-attribution a:hover { color: var(--amplify-teal) !important; }

/* ---- Mobile panel toggle ---- */
.mp-side-toggle {
    position: absolute;
    left: 50%;
    bottom: var(--space-4);
    transform: translateX(-50%);
    z-index: 850;
    display: none;
    align-items: center;
    gap: var(--space-2);
    min-height: 46px;
    padding: 10px 20px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    background: var(--card-bg-strong);
    backdrop-filter: saturate(170%) blur(24px);
    -webkit-backdrop-filter: saturate(170%) blur(24px);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.mp-side-toggle i { color: var(--amplify-teal); }

.mp-toggle-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 3px 7px;
    border-radius: var(--radius-pill);
    background: var(--amplify-teal);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 900px) {
    .mp-layout { grid-template-columns: 1fr; }

    /* Panel becomes a slide-up sheet over the map */
    .mp-side {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 18%;
        border-right: none;
        border-top: 1px solid var(--card-border);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        box-shadow: var(--shadow-xl);
        transform: translateY(105%);
        transition: transform var(--transition-slow);
    }

    .mp-side.is-open { transform: translateY(0); }

    .mp-side-head { padding: var(--space-5) var(--space-5) var(--space-3); }
    .mp-sub { display: none; }
    .mp-tools { padding: 0 var(--space-5) var(--space-3); }
    .mp-side-toggle { display: inline-flex; }
    .mp-mode { top: var(--space-3); }
    .mp-controls { bottom: calc(var(--space-4) + 64px); }
    .mp-legend { bottom: calc(var(--space-4) + 64px); left: var(--space-3); width: 160px; }
}

@media (max-width: 560px) {
    .mp-mode-btn { padding: 6px 11px; font-size: var(--text-xs); }
    .mp-ctrl { width: 38px; height: 38px; }
    .mp-h1 { font-size: 22px; }
    .mp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .mp-side, .mp-cluster, .mp-chip, .mp-card, .mp-ctrl,
    .mp-mode-btn, .pub-btn, .mp-pin-circle, .mp-toast { transition: none; }
    .mp-pin { animation: none; }
    .mp-pin.is-focus .mp-pin-circle { animation: none; box-shadow: 0 0 0 5px rgba(0, 146, 160, 0.3); }
}