/* =========================================================
   SnapUp Events — Unified Upload Screen
   Shared by Home, Event Gallery and Event Detail.
   Keep upload UI changes here so all three surfaces stay identical.
   ========================================================= */

/* Exact shared upload UI copied from homepage/event-gallery. */
/* Shared homepage upload modal variables */
.join-upload-modal,
.join-upload-success {
  --paper: #ffffff;
  --ink: #201a35;
  --ink-soft: rgba(32, 26, 53, 0.68);
  --coral: #7c3aed;
  --coral-2: #ec4899;
  --font:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --mono: "JetBrains Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.join-upload-open {
  overflow: hidden;
}

.join-upload-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.join-upload-modal.active {
  display: flex;
}

.join-upload-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 10, 36, 0.74);
  backdrop-filter: blur(16px);
}

.join-upload-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 620px);
  max-height: min(90vh, 820px);
  overflow-y: auto;
  border-radius: 30px;
  padding: 28px;
  color: var(--ink);
  background:
    radial-gradient(
      circle at top left,
      rgba(124, 58, 237, 0.16),
      transparent 34%
    ),
    var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.38);
}

.join-upload-panel::-webkit-scrollbar {
  width: 9px;
}

.join-upload-panel::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(32, 26, 53, 0.06);
}

.join-upload-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(32, 26, 53, 0.28);
}

.join-upload-close {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(32, 26, 53, 0.08);
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.join-upload-head {
  padding-right: 44px;
  margin-bottom: 22px;
}

.join-upload-head span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--coral);
  font: 900 12px/1 var(--mono);
  letter-spacing: 0.14em;
}

.join-upload-head span i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.14);
}

.join-upload-head h2 {
  margin-top: 12px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.join-upload-head p {
  margin-top: 10px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.join-upload-form {
  display: grid;
  gap: 16px;
}

.join-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.join-upload-form label {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.join-upload-form input,
.join-upload-form textarea {
  width: 100%;
  border: 1px solid rgba(32, 26, 53, 0.13);
  border-radius: 16px;
  background: #f1ecff;
  color: var(--ink);
  outline: 0;
  padding: 14px 15px;
  font: inherit;
}

.join-upload-form textarea {
  min-height: 120px;
  resize: vertical;
}

.join-upload-form input:focus,
.join-upload-form textarea:focus {
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.join-file-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}

.join-upload-form .join-file-picker {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  min-height: 82px;
  overflow: hidden;
  padding: 13px 15px;
  border: 1px dashed rgba(124, 58, 237, 0.34);
  border-radius: 20px;
  background:
    radial-gradient(
      circle at 8% 12%,
      rgba(124, 58, 237, 0.13),
      transparent 38%
    ),
    linear-gradient(135deg, #f5f0ff 0%, #fff8fd 100%);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 28px rgba(68, 42, 122, 0.07);
  transition:
    transform 0.2s var(--ease),
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.join-upload-form .join-file-picker:hover,
.join-upload-form .join-file-picker:focus-within,
.join-upload-form .join-file-picker.is-dragover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.72);
  background:
    radial-gradient(
      circle at 8% 12%,
      rgba(124, 58, 237, 0.2),
      transparent 42%
    ),
    linear-gradient(135deg, #f2ebff 0%, #fff3fb 100%);
  box-shadow:
    0 0 0 4px rgba(124, 58, 237, 0.09),
    0 16px 34px rgba(68, 42, 122, 0.12);
}

.join-upload-form .join-file-picker.has-files {
  border-style: solid;
  border-color: rgba(22, 163, 74, 0.35);
}

.join-upload-form .join-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.join-file-picker__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(145deg, #7c3aed, #ec4899);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.24);
}

.join-file-picker__icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.join-file-picker__copy {
  min-width: 0;
}

.join-file-picker__copy strong,
.join-file-picker__copy span {
  display: block;
}

.join-file-picker__copy strong {
  color: #17122b;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.join-file-picker__copy span {
  margin-top: 4px;
  color: rgba(23, 18, 43, 0.58);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.join-file-picker__count {
  min-width: 47px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.1);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.join-file-picker__count[hidden] {
  display: none;
}

.join-file-picker__arrow {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(23, 18, 43, 0.64);
  background: rgba(255, 255, 255, 0.72);
  transition:
    transform 0.2s var(--ease),
    color 0.2s var(--ease);
}

.join-file-picker:hover .join-file-picker__arrow,
.join-file-picker:focus-within .join-file-picker__arrow {
  transform: translateX(2px);
  color: #7c3aed;
}

.join-file-picker__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.join-event-preview {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(118, 209, 144, 0.13);
  border: 1px solid rgba(22, 128, 60, 0.18);
}

.join-event-preview[hidden] {
  display: none;
}

.join-event-cover {
  position: relative;
  width: 108px;
  height: 86px;
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #7c3aed;
  background:
    radial-gradient(
      circle at 22% 18%,
      rgba(236, 72, 153, 0.2),
      transparent 42%
    ),
    #eee7ff;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 14px;
}

.join-event-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.join-event-cover img[hidden],
.join-event-cover span[hidden] {
  display: none;
}

.join-event-cover span {
  display: grid;
  place-items: center;
}

.join-event-cover svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.join-event-preview__details {
  min-width: 0;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.join-event-preview strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.join-event-preview span {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 13px;
}

.join-event-preview .join-event-address {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.join-event-map-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  padding: 7px 9px;
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.join-event-map-link[hidden] {
  display: none;
}

.join-event-map-link:hover {
  transform: translateY(-1px);
  background: rgba(124, 58, 237, 0.13);
  border-color: rgba(124, 58, 237, 0.3);
}

html[data-theme="dark"] .join-event-map-link {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(196, 181, 253, 0.22);
}

html[data-theme="dark"] .join-event-map-link:hover {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(196, 181, 253, 0.38);
}

.join-event-map-link svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.join-event-preview .join-event-map-link span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

body.event-gallery-shell .join-event-gallery-link {
  grid-column: 3;
  grid-row: 1 / span 2;
  min-width: 132px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #17122b;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(23, 18, 43, 0.16);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

body.event-gallery-shell .join-event-gallery-link:hover {
  transform: translateY(-2px);
}

.join-event-gallery-link[hidden] {
  display: none;
}

.join-media-type {
  display: grid;
  gap: 10px;
}

.join-media-type > span {
  font-weight: 900;
}

.join-media-type div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.join-media-type button {
  min-height: 54px;
  border: 1px solid rgba(32, 26, 53, 0.12);
  border-radius: 16px;
  background: #eee7ff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.join-media-type button:hover,
.join-media-type button.active {
  transform: translateY(-2px);
  background: var(--ink);
  color: white;
}

.join-file-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(23, 18, 43, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.58),
      rgba(255, 250, 242, 0.94)
    ),
    rgba(255, 250, 242, 0.9);
  box-shadow:
    0 16px 36px rgba(23, 18, 43, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.join-selected-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.join-selected-header strong {
  display: block;
  color: #17122b;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.join-selected-header span {
  display: block;
  margin-top: 4px;
  color: rgba(23, 18, 43, 0.58);
  font-size: 12px;
  font-weight: 800;
}

.join-clear-files-button {
  min-height: 34px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.1);
  color: #7c3aed;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.join-clear-files-button:hover {
  transform: translateY(-1px);
  background: rgba(236, 72, 153, 0.18);
}

.join-selected-file-list {
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-right: 6px;
}

.join-selected-file-list::-webkit-scrollbar {
  width: 7px;
}

.join-selected-file-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(23, 18, 43, 0.06);
}

.join-selected-file-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(23, 18, 43, 0.22);
}

.join-selected-file-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(23, 18, 43, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.join-selected-file-thumb {
  width: 68px;
  height: 58px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #17122b;
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
}

.join-selected-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.join-selected-file-thumb.video-thumb {
  background:
    radial-gradient(
      circle at 30% 25%,
      rgba(247, 177, 76, 0.38),
      transparent 34%
    ),
    #17122b;
}

.join-selected-file-info {
  min-width: 0;
}

.join-selected-file-info strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #17122b;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-selected-file-info span {
  display: block;
  margin-top: 5px;
  color: rgba(23, 18, 43, 0.54);
  font-size: 11px;
  font-weight: 800;
}

.join-remove-file-button {
  min-height: 34px;
  padding: 8px 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 18, 43, 0.08);
  color: rgba(23, 18, 43, 0.72);
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.join-remove-file-button:hover {
  transform: translateY(-1px);
  background: rgba(236, 72, 153, 0.16);
  color: #7c3aed;
}

.join-file-helper-text {
  margin: 12px 0 0;
  color: rgba(23, 18, 43, 0.52);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.join-submit-button {
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--coral), var(--coral-2));
  color: white;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 16px 35px rgba(124, 58, 237, 0.25);
}

.join-submit-button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}

.join-upload-result {
  min-height: 22px;
  font-weight: 800;
}

.join-upload-result.info {
  color: var(--ink-soft);
}

.join-upload-result.success {
  color: #16803c;
}

.join-upload-result.error {
  color: #d62828;
}

.join-upload-success {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.join-upload-success[hidden] {
  display: none;
}

.join-upload-success.active {
  opacity: 1;
  visibility: visible;
}

.join-upload-success__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 10, 36, 0.68);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.join-upload-success__card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  overflow: hidden;
  padding: 38px 34px 32px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 30px;
  color: #17122b;
  text-align: center;
  background: #ffffff;
  box-shadow:
    0 38px 110px rgba(10, 6, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(18px) scale(0.96);
  transition: transform 0.24s var(--ease);
}

.join-upload-success.active .join-upload-success__card {
  transform: translateY(0) scale(1);
}

.join-upload-success__icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #7c3aed, #ec4899 55%, #22d3c5);
  box-shadow:
    0 20px 42px rgba(124, 58, 237, 0.28),
    0 0 0 9px rgba(124, 58, 237, 0.08);
}

.join-upload-success__icon svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.join-upload-success.active .join-upload-success__icon {
  animation: join-success-pop 0.5s 0.1s both;
}

.join-upload-success__brand {
  display: inline-flex;
  color: #7c3aed;
  font: 900 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.join-upload-success__card h2 {
  margin: 12px 0 0;
  color: #17122b;
  font-size: clamp(31px, 7vw, 44px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.join-upload-success__card p {
  margin: 14px auto 0;
  max-width: 330px;
  color: rgba(23, 18, 43, 0.66);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.55;
}

.join-upload-success__note {
  white-space: pre-line;
  margin-top: 10px !important;
  padding: 10px 12px;
  max-width: 360px !important;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.06);
  color: rgba(23, 18, 43, 0.72) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
}

.join-upload-success__note[hidden] {
  display: none;
}

.join-upload-success__button {
  width: 100%;
  min-height: 56px;
  margin-top: 26px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  background: #17122b;
  font: 950 15px/1 var(--font);
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(23, 18, 43, 0.2);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.join-upload-success__button:hover,
.join-upload-success__button:focus-visible {
  transform: translateY(-2px);
  background: #7c3aed;
  box-shadow: 0 18px 38px rgba(124, 58, 237, 0.26);
  outline: none;
}

.join-submit-button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.join-submit-button.is-loading::before {
  width: 17px;
  height: 17px;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: join-upload-spin 0.75s linear infinite;
}

@keyframes join-success-pop {
  0% {
    opacity: 0;
    transform: scale(0.58) rotate(-8deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes join-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .join-upload-modal {
    padding: 14px;
  }

  .join-upload-panel {
    border-radius: 24px;
    padding: 22px;
  }

  .join-upload-grid {
    grid-template-columns: 1fr;
  }

  .join-media-type div {
    grid-template-columns: 1fr;
  }

  .join-event-preview {
    grid-template-columns: 1fr;
  }

  .join-event-cover,
  .join-event-preview__details,
  .join-event-gallery-link {
    grid-column: 1;
    grid-row: auto;
  }

  .join-event-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 8.5;
    border-radius: 16px;
  }

  .join-event-gallery-link {
    width: 100%;
  }

  .join-upload-form .join-file-picker {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 11px;
    min-height: 76px;
    padding: 12px;
  }

  .join-file-picker__icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .join-file-picker__arrow {
    display: none;
  }

  .join-file-picker__count {
    min-width: 43px;
    padding: 7px 8px;
  }

  .join-selected-file-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .join-selected-file-thumb {
    width: 58px;
    height: 52px;
  }

  .join-remove-file-button {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }

  .join-upload-success {
    align-items: end;
    padding: 12px;
  }

  .join-upload-success__card {
    width: 100%;
    padding: 32px 22px 22px;
    border-radius: 28px;
    transform: translateY(34px);
  }

  .join-upload-success__icon {
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
  }

  .join-upload-success__icon svg {
    width: 41px;
    height: 41px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .join-upload-success,
  .join-upload-success__card,
  .join-upload-success__icon,
  .join-submit-button.is-loading::before {
    animation: none;
    transition: none;
  }
}

/* =========================================================
   Event Gallery — mobile event preview vertical card
   Matches the requested upload-modal layout:
   large cover, event info, Maps action, full-width Gallery CTA.
   ========================================================= */
@media (max-width: 640px) {
  .join-event-preview {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 0 !important;
    align-items: stretch !important;
    padding: 12px !important;
    background: #eef8f1 !important;
    border: 1px solid rgba(89, 161, 110, 0.28) !important;
    border-radius: 18px !important;
    box-shadow: none !important;
  }

  .join-event-cover {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 132px !important;
    aspect-ratio: auto !important;
    margin: 0 0 11px !important;
    overflow: hidden !important;
    border: 1px solid rgba(84, 154, 104, 0.24) !important;
    border-radius: 14px !important;
    background: #e6f3e9 !important;
  }

  .join-event-cover img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  .join-event-preview__details {
    grid-column: 1 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 0 !important;
  }

  .join-event-preview__details > strong {
    margin: 0 !important;
    color: #2a2037 !important;
    font-size: 16px !important;
    font-weight: 850 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.015em !important;
  }

  .join-event-preview__details > #joinEventMeta {
    display: block !important;
    margin-top: 5px !important;
    color: #726a7a !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
  }

  .join-event-preview .join-event-address {
    display: -webkit-box !important;
    width: 100% !important;
    margin-top: 5px !important;
    color: #7f7885 !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
  }

  .join-event-map-link {
    width: fit-content !important;
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin: 9px 0 0 !important;
    padding: 7px 11px !important;
    color: #7808d0 !important;
    background: rgba(120, 8, 208, 0.045) !important;
    border: 1px solid rgba(120, 8, 208, 0.17) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    font-size: 10px !important;
    font-weight: 850 !important;
  }

  .join-event-map-link:hover,
  .join-event-map-link:active {
    color: #6607b2 !important;
    background: rgba(120, 8, 208, 0.08) !important;
    border-color: rgba(120, 8, 208, 0.24) !important;
    transform: none !important;
  }

  .join-event-map-link svg {
    width: 13px !important;
    height: 13px !important;
  }

  /* Gallery CTA becomes the strong full-width action at the bottom. */
  body.event-gallery-shell .join-event-gallery-link {
    grid-column: 1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    margin: 11px 0 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: #17122b !important;
    border: 1px solid #17122b !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    text-align: center !important;
  }

  body.event-gallery-shell .join-event-gallery-link:hover,
  body.event-gallery-shell .join-event-gallery-link:active {
    background: #0f0b20 !important;
    border-color: #0f0b20 !important;
    transform: none !important;
  }

  html[data-theme="dark"] .join-event-preview {
    background: #1c2a20 !important;
    border-color: rgba(117, 190, 137, 0.22) !important;
  }

  html[data-theme="dark"] .join-event-cover {
    background: #23372a !important;
    border-color: rgba(117, 190, 137, 0.20) !important;
  }

  html[data-theme="dark"] .join-event-preview__details > strong {
    color: #f5eff8 !important;
  }

  html[data-theme="dark"] .join-event-preview__details > #joinEventMeta {
    color: #d1c8d6 !important;
  }

  html[data-theme="dark"] .join-event-preview .join-event-address {
    color: #b9b0bd !important;
  }

  html[data-theme="dark"] .join-event-map-link {
    color: #d4aaf2 !important;
    background: rgba(120, 8, 208, 0.12) !important;
    border-color: rgba(196, 136, 238, 0.20) !important;
  }
}

/* =========================================================
   Event Gallery — compact mobile upload controls
   Keeps the vertical event card, but reduces the lower form height.
   ========================================================= */
@media (max-width: 640px) {
  .join-upload-form {
    gap: 11px !important;
  }

  /* Choose Media: 3 equal buttons on one row. */
  .join-media-type {
    gap: 7px !important;
  }

  .join-media-type > span {
    font-size: 15px !important;
    line-height: 1.2 !important;
  }

  .join-media-type div {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .join-media-type button {
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 7px 6px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    line-height: 1 !important;
  }

  .join-media-type button:hover,
  .join-media-type button.active {
    transform: none !important;
  }

  /* Message section: less vertical space. */
  .join-message-field label {
    gap: 7px !important;
    font-size: 15px !important;
  }

  .join-upload-form textarea,
  #joinMessageText {
    min-height: 92px !important;
    height: 92px !important;
    padding: 12px 13px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  /* File picker follows the same compact rhythm for Image/Video. */
  .join-upload-form .join-file-picker {
    min-height: 64px !important;
    grid-template-columns: 40px minmax(0, 1fr) auto !important;
    gap: 9px !important;
    padding: 9px 10px !important;
    border-radius: 14px !important;
  }

  .join-file-picker__icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 11px !important;
    box-shadow: none !important;
  }

  .join-file-picker__icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  .join-file-picker__copy strong {
    font-size: 12px !important;
  }

  .join-file-picker__copy span {
    margin-top: 2px !important;
    font-size: 10px !important;
  }

  .join-file-picker__count {
    min-width: 38px !important;
    padding: 5px 7px !important;
    font-size: 10px !important;
  }

  .join-file-helper-text {
    margin: 6px 0 0 !important;
    font-size: 9.5px !important;
    line-height: 1.35 !important;
  }

  /* Turnstile: tighter shell, no oversized empty padding. */
  #joinTurnstileField.turnstile-field {
    margin: 1px 0 0 !important;
    padding: 8px 9px !important;
    border-radius: 13px !important;
  }

  #joinTurnstileWidget.turnstile-widget {
    min-height: 64px !important;
  }

  #joinTurnstileMessage.turnstile-message {
    min-height: 0 !important;
    margin-top: 2px !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
  }

  /* Main CTA: compact but still easy to tap. */
  .join-submit-button {
    min-height: 46px !important;
    border-radius: 13px !important;
    background: #7808d0 !important;
    background-image: none !important;
    box-shadow: none !important;
    font-size: 12px !important;
  }

  .join-submit-button:not(:disabled):active {
    background: #6607b2 !important;
  }

  .join-upload-result {
    min-height: 0 !important;
    margin: 0 !important;
    font-size: 10px !important;
  }

  /* Reduce the gap after the green event preview card. */
  .join-event-preview {
    margin-bottom: 1px !important;
  }
}


/* Unified SnapUp action color overrides */
.join-submit-button {
  background: #7808d0 !important;
  background-image: none !important;
  border-color: #7808d0 !important;
  box-shadow: none !important;
}

.join-submit-button:not(:disabled):hover,
.join-submit-button:not(:disabled):focus-visible {
  background: #6607b2 !important;
  border-color: #6607b2 !important;
}

.join-media-type button.active {
  box-shadow: none !important;
}

@media (max-width: 640px) {
  /* One identical mobile panel size/scroll behavior everywhere. */
  .join-upload-modal {
    padding: 10px !important;
  }

  .join-upload-panel {
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 20px !important;
    border-radius: 26px !important;
  }

  .join-upload-head {
    margin-bottom: 15px !important;
  }

  .join-upload-head h2 {
    font-size: clamp(30px, 10vw, 40px) !important;
  }

  .join-upload-head p {
    margin-top: 8px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }
}



/* =========================================================
   Unified upload — keep Cloudflare Turnstile inside narrow cards
   Flexible Turnstile is already enabled in turnstile.js.
   These rules ensure the iframe follows the actual inner width.
   ========================================================= */
.join-upload-modal .turnstile-field,
.join-upload-panel .turnstile-field,
#joinTurnstileField.turnstile-field {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.join-upload-modal .turnstile-widget,
.join-upload-panel .turnstile-widget,
#joinTurnstileWidget.turnstile-widget {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#joinTurnstileWidget > div,
#joinTurnstileWidget iframe {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* On very narrow phones, give the widget almost the full card width. */
@media (max-width: 420px) {
  #joinTurnstileField.turnstile-field {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  #joinTurnstileWidget.turnstile-widget {
    margin-inline: auto !important;
  }
}



/* =========================================================
   Unified upload — Turnstile narrow-phone scale fix
   Cloudflare's inner challenge can keep a ~300px intrinsic width.
   Scale the generated widget itself so it fits inside the card.
   ========================================================= */
@media (max-width: 420px) {
  #joinTurnstileField.turnstile-field {
    padding: 6px !important;
    overflow: hidden !important;
  }

  #joinTurnstileWidget.turnstile-widget {
    min-height: 58px !important;
    height: 58px !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
  }

  #joinTurnstileWidget > div {
    width: 113.64% !important;
    max-width: none !important;
    min-width: 0 !important;
    transform: scale(0.88) !important;
    transform-origin: top left !important;
  }

  #joinTurnstileWidget > div iframe {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  #joinTurnstileMessage.turnstile-message {
    margin-top: 1px !important;
  }
}

/* Extra safety for very narrow devices (<= 360px CSS viewport). */
@media (max-width: 360px) {
  #joinTurnstileWidget.turnstile-widget {
    min-height: 55px !important;
    height: 55px !important;
  }

  #joinTurnstileWidget > div {
    width: 117.65% !important;
    transform: scale(0.85) !important;
  }
}



/* =========================================================
   Unified upload — respect JS hidden state on every viewport
   Prevent mobile !important layout rules from exposing empty UI.
   ========================================================= */
.join-upload-panel .join-event-preview[hidden],
.join-upload-panel .join-event-map-link[hidden],
.join-upload-panel .join-event-gallery-link[hidden],
.join-upload-panel .turnstile-field[hidden],
.join-upload-panel .join-message-field[hidden],
.join-upload-panel .join-file-field[hidden],
.join-upload-panel .join-file-preview[hidden],
.join-upload-panel .join-event-cover img[hidden],
.join-upload-panel .join-event-cover span[hidden] {
  display: none !important;
}



/* =========================================================
   Unified upload — tiny gap between Maps and Gallery actions
   ========================================================= */
@media (max-width: 640px) {
  .join-event-preview > .join-event-gallery-link {
    margin-top: 6px !important;
  }
}

