/* Event finder page (/events/). */
.ev-main { padding-top: 24px; }  /* same gap under the header as the tracker */
.ev-main [hidden] { display: none !important; }
.ev-title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 6px; }
.ev-sub { color: var(--muted); margin: 0 0 20px; }

.ev-form {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.ev-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.ev-field input, .ev-field select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font: inherit; font-size: 1rem; min-width: 150px;
}
.ev-field input { text-transform: uppercase; }
.ev-field input::placeholder { text-transform: none; }
.ev-types { border: 0; padding: 0; margin: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.95rem; }
.ev-types legend { font-size: 0.85rem; color: var(--muted); padding: 0; margin-bottom: 6px; }
.ev-types label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 0; }

.ev-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ev-dot.ev-cup, .ev-badge.ev-cup { background: #2F5BEA; }
.ev-dot.ev-challenge, .ev-badge.ev-challenge { background: #f59e0b; }

.ev-views { display: flex; gap: 8px; margin: 18px 0 0; }
.ev-view {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 0.9rem; cursor: pointer;
}
.ev-view.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.ev-field-pc { flex: 1 1 260px; }
.ev-pc { display: flex; gap: 8px; }
.ev-pc input { flex: 1; min-width: 0; }
.ev-locate { white-space: nowrap; padding: 8px 12px; font-size: 0.9rem; }
.ev-small { padding: 6px 12px; font-size: 0.85rem; }

.ev-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 14px 0 10px; }
.ev-bar .ev-status { margin: 0; }
.ev-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; }
.ev-sort select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font: inherit;
}
.ev-sort select:disabled { opacity: 0.5; }
.ev-miles { margin-left: 8px; font-size: 0.8rem; color: var(--muted); }

.ev-status { min-height: 1.4em; margin: 14px 0 10px; color: var(--muted); }
.ev-status.ev-error { color: #fca5a5; }

.ev-map { height: 420px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--surface); }
.ev-home { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 0 0 3px rgba(47,91,234,0.3); }
.ev-popup { color: #111; font-size: 0.85rem; display: grid; gap: 4px; }
.ev-popup-row { display: flex; align-items: center; gap: 6px; }

.ev-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.ev-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
}
.ev-item:hover, .ev-item:focus-visible, .ev-item.active { border-color: var(--accent); outline: none; }
.ev-item h3 { font-size: 1rem; margin: 6px 0 4px; overflow-wrap: anywhere; }
.ev-item p { margin: 2px 0; font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }
.ev-item .ev-when { color: var(--text); }
.ev-badge { display: inline-block; color: #fff; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.ev-badge.ev-challenge { color: #1a1300; }
.ev-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.ev-item-actions .ev-cal { background: none; border-color: transparent; color: var(--accent); padding-left: 0; padding-right: 0; }
.ev-item-actions a { color: var(--accent); font-size: 0.9rem; }
.ev-save { padding: 6px 14px; font-size: 0.9rem; }
.ev-save.saved { border-color: var(--green); color: var(--green); }

.ev-credit { color: var(--muted); font-size: 0.8rem; margin-top: 24px; }
.ev-credit a { color: inherit; }

@media (max-width: 600px) {
  .ev-field { flex: 1 1 100%; }
  .ev-field input, .ev-field select { min-width: 0; width: 100%; }
  .ev-form .btn-primary { width: 100%; }
  .ev-map { height: 320px; }
  .ev-item { flex-direction: column; }
  .ev-item-actions { flex-direction: row; flex-wrap: wrap; align-items: center; width: 100%; gap: 8px 14px; }
  .ev-item-actions .ev-save { margin-left: auto; }
}
