.trial-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.trial-modal-overlay[hidden] {
  display: none !important;
}

.trial-modal {
  background: #fff;
  border-radius: 20px;
  width: min(720px, 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  margin: auto 0;
}

.trial-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.trial-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
}

.trial-modal-close {
  border: none;
  background: #F3F4F6;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  color: #6B7280;
}

.trial-modal-body {
  padding: 20px 24px;
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.trial-benefits {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(108, 71, 255, 0.08));
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.trial-benefits-lead {
  font-weight: 800;
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.trial-benefits-list {
  margin: 0;
  padding: 0 20px 0 0;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--muted);
}

.trial-terms-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #92400E;
}

.trial-accuracy-note {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.65;
  margin: 0 0 18px;
  color: #78350F;
}

.trial-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.trial-field {
  margin-bottom: 14px;
}

.trial-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #374151;
}

.trial-field input,
.trial-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  box-sizing: border-box;
}

.trial-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 4px 0 8px;
}

.trial-emoji-grid {
  display: none;
}

.trial-map {
  height: 260px;
  border-radius: 12px;
  border: 1px solid var(--border);
  z-index: 1;
}

.trial-media-box {
  background: #F8FAFC;
  border: 2px dashed rgba(14, 165, 233, 0.35);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
}

.trial-media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.trial-media-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trial-media-title {
  font-size: 1rem;
  font-weight: 900;
  color: #0F172A;
}

.trial-media-badge {
  background: linear-gradient(135deg, #0EA5E9, #6C47FF);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.trial-media-optional {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6B7280;
  background: #E5E7EB;
  padding: 3px 10px;
  border-radius: 999px;
}

.trial-media-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #475569;
  margin: 0 0 14px;
}

.trial-media-desc strong {
  color: #0EA5E9;
}

.trial-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.trial-thumb-btn {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #E5E7EB;
  padding: 0;
  cursor: pointer;
  background: #E5E7EB;
}

.trial-thumb-btn.is-active {
  border-color: #6C47FF;
  box-shadow: 0 0 0 2px rgba(108, 71, 255, 0.25);
}

.trial-thumb-btn img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.trial-thumb-star {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  background: #FFD700;
  border-radius: 6px;
  padding: 1px 3px;
  line-height: 1.2;
}

.trial-gallery-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.trial-gallery-action-btn {
  border: 1px solid #E5E7EB;
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.trial-gallery-action-btn--danger {
  color: #DC2626;
  border-color: #FECACA;
  background: #FEF2F2;
}

.trial-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #0EA5E9;
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
}

.trial-upload-btn.is-hidden {
  display: none;
}

.trial-upload-btn--secondary {
  background: #6C47FF;
}

.trial-pan-box {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #0EA5E9;
  background: #1F2937;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.trial-pan-box--gallery {
  max-width: min(100%, 340px);
}

.trial-pan-box--logo {
  max-width: 220px;
}

.trial-square-note {
  text-align: center;
  font-size: 0.78rem;
  color: #64748B;
  margin: 6px 0 0;
}

.trial-logo-status {
  font-size: 0.85rem;
  font-weight: 700;
  color: #059669;
  margin: 8px 0 0;
}

.trial-logo-status.is-error {
  color: #DC2626;
}

.trial-logo-preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #6C47FF;
  margin-top: 8px;
}

.trial-logo-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.join-form-status--loading {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.trial-pan-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.trial-pan-hud {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.trial-pan-coords {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.trial-pan-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.trial-pan-tool-btn {
  border: 1px solid #E5E7EB;
  background: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.trial-editor-empty {
  font-size: 0.85rem;
  color: #9CA3AF;
  text-align: center;
  padding: 20px 10px;
  margin: 0;
}

.trial-gallery-editor-wrap,
.trial-logo-editor-wrap {
  margin-top: 8px;
}

.trial-terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  line-height: 1.55;
  cursor: pointer;
  margin-top: 8px;
}

.trial-terms-check input {
  margin-top: 4px;
  flex-shrink: 0;
}

.trial-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

.join-trial-link {
  margin: 0 0 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--sky);
  font-weight: 800;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

@media (max-width: 560px) {
  .trial-form-row { grid-template-columns: 1fr; }
  .trial-modal-body { max-height: none; }
}
