.keo-livesearch-form {
  position: relative;
}

.keo-livesearch-shortcode {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  margin: 28px auto;
  max-width: 1180px;
  position: relative;
}

.keo-livesearch-shortcode__form {
  align-items: stretch;
  align-self: center;
  background: #fff;
  margin: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
}

.keo-livesearch-shortcode__input[type="search"] {
  background: #fff;
  border: 0 !important;
  border-bottom: 0 !important;
  color: #111827;
  font-size: 28px;
  line-height: 1.2;
  min-height: 86px;
  min-width: 0;
  padding: 22px 24px;
  width: 100%;
}

.keo-livesearch-shortcode__input[type="search"]::placeholder {
  color: #6b7280;
  opacity: 1 !important;
}

.keo-livesearch-shortcode__input[type="search"]:focus {
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.keo-livesearch-shortcode__form:focus-within {
  border-color: #0b6a55;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  outline: 0;
}

.keo-livesearch-shortcode__button {
  background: #0b6a55;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0.04em;
  min-width: 86px;
  padding: 0;
  text-transform: uppercase;
}

.keo-livesearch-shortcode__button:hover,
.keo-livesearch-shortcode__button:focus-visible {
  background: #095544;
}

.keo-livesearch-shortcode__bubble {
  align-self: center;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
  color: #1f2937;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.38;
  padding: 18px 20px;
  position: relative;
}

.keo-livesearch-shortcode__bubble::before,
.keo-livesearch-shortcode__bubble::after {
  border-bottom: 12px solid transparent;
  border-top: 12px solid transparent;
  content: "";
  height: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
}

.keo-livesearch-shortcode__bubble::before {
  border-right: 14px solid #d1d5db;
  left: -14px;
}

.keo-livesearch-shortcode__bubble::after {
  border-right: 13px solid #fff;
  left: -12px;
}

.keo-livesearch-layer {
  position: relative;
}

.keo-livesearch {
  background: #fff;
  border: 1px solid rgba(24, 28, 32, 0.14);
  border-radius: 6px;
  box-shadow: 0 18px 44px rgba(24, 28, 32, 0.18);
  color: #1d2327;
  font-family: 'Merriweather Sans', sans-serif;
  max-height: min(70vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  position: fixed;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  z-index: 100;
}

.keo-livesearch.is-grouped {
  padding: 10px;
}

.keo-livesearch[hidden] {
  display: none;
}

.keo-livesearch__item {
  align-items: center;
  border-radius: 5px;
  color: inherit;
  display: grid;
  gap: 10px;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 66px;
  padding: 7px;
  text-decoration: none;
}

.keo-livesearch__item:hover,
.keo-livesearch__item[aria-selected="true"] {
  background: #f1f5f4;
  color: inherit;
  text-decoration: none;
}

.keo-livesearch__groups {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.keo-livesearch__group {
  min-width: 0;
}

.keo-livesearch__group-title {
  color: #475467;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  padding: 6px 7px 8px;
  text-transform: uppercase;
}

.keo-livesearch__media {
  align-items: center;
  background: #f6f7f7;
  border-radius: 4px;
  display: flex;
  height: 52px;
  justify-content: center;
  overflow: hidden;
  width: 52px;
}

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

.keo-livesearch__body {
  display: block;
  min-width: 0;
}

.keo-livesearch__title {
  display: block;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.keo-livesearch__meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.keo-livesearch__badge {
  background: #f0faf6;
  border-radius: 3px;
  color: #155e46;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 6px;
}

.keo-livesearch__badge--event {
  background: #f0faf6;
  color: #155e46;
}

.keo-livesearch__venue {
  color: #475467;
  font-size: 13px;
  line-height: 1.2;
}

.keo-livesearch__excerpt {
  color: #6b7280;
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 100%;
}

.keo-livesearch__reg-slot {
  margin-top: 7px;
}

.keo-livesearch .sleyembed-card__actions .keo-livesearch__reg-slot {
  align-items: stretch;
  display: flex;
  flex: 0 0 auto;
  max-width: 100%;
  margin-top: 0;
}

.keo-livesearch__reg-btn {
  align-items: center;
  border-radius: 4px;
  box-sizing: border-box;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
  line-height: 1.2;
  min-height: 24px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.keo-livesearch .sleyembed-card__actions .keo-livesearch__reg-btn {
  flex: 0 0 auto;
  max-width: 100%;
  overflow-wrap: normal;
  white-space: nowrap !important;
  width: auto;
  word-break: normal;
}

.keo-livesearch__reg-btn--open {
  background: #0c7a60;
}

.keo-livesearch__reg-btn--open:hover {
  background: #095544;
  color: #fff;
}

.keo-livesearch__reg-btn--pending {
  background: #f59e0b;
  cursor: default;
}

.keo-livesearch__status,
.keo-livesearch__all {
  border-radius: 5px;
  display: block;
  font-size: 14px;
  line-height: 1.3;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.keo-livesearch__status {
  color: #475467;
}

.keo-livesearch__status.is-error {
  color: #9f1239;
}

.keo-livesearch__all {
  background: #f6f7f7;
  border: 0;
  color: #1d2327;
  cursor: pointer;
  font-weight: 650;
  margin-top: 4px;
}

.keo-livesearch__all:hover,
.keo-livesearch__all:focus-visible {
  background: #e7ecea;
}

/* ---- Tapahtumakortit (sleyembed-card, scoped to panel) ---- */
.keo-livesearch .sleyembed-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  margin: 4px 2px;
  padding: 14px;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.keo-livesearch .sleyembed-card[aria-selected="true"],
.keo-livesearch .sleyembed-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.keo-livesearch .sleyembed-card__body {
  color: #111827;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 6px;
  line-height: 1.35;
}

.keo-livesearch .keo-has-thumb .sleyembed-card__body {
  padding-right: calc(60px + 10px);
}

.keo-livesearch .keo-card-thumb {
  background: #e8e4df;
  border-radius: 6px;
  display: block;
  height: 60px;
  object-fit: cover;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 60px;
}

.keo-livesearch .sleyembed-card__top {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.keo-livesearch .sleyembed-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 5px;
  padding: 3px 8px;
}

.keo-livesearch .sleyembed-badge--day {
  background: #084f3f;
  color: #fff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.keo-livesearch .sleyembed-badge--time {
  background: #0c7a60;
  color: #fff;
}

.keo-livesearch .sleyembed-badge--live {
  background: #b91c1c;
  color: #fff;
}

.keo-livesearch .sleyembed-badge__icon {
  background: no-repeat center/contain;
  display: inline-block;
  flex: 0 0 12px;
  font-size: 0;
  height: 12px;
  line-height: 0;
  width: 12px;
}

.keo-livesearch .sleyembed-badge__icon::before {
  content: none !important;
}

.keo-livesearch .sleyembed-badge__label {
  line-height: 1;
}

.keo-livesearch .fa-regular.fa-calendar.sleyembed-badge__icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

.keo-livesearch .fa-regular.fa-clock.sleyembed-badge__icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.keo-livesearch .fa-solid.fa-calendar-days.sleyembed-badge__icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3Cpath d='M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01'/%3E%3C/svg%3E");
}

.keo-livesearch .sleyembed-card__title {
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.keo-livesearch .keo-card-title-link {
  color: inherit;
  text-decoration: none;
}

.keo-livesearch .keo-card-title-link:hover {
  color: #0c7a60;
  text-decoration: underline;
}

.keo-livesearch .sleyembed-card__subtitle {
  color: #4b5563;
  font-size: 12px;
  margin: 0;
}

.keo-livesearch .sleyembed-card__kv {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
}

.keo-livesearch .sleyembed-card__kv span {
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
}

.keo-livesearch .sleyembed-card__kv strong {
  color: #1f2937;
  font-size: 12px;
  font-weight: 600;
}

.keo-livesearch .sleyembed-card__desc {
  color: #374151;
  font-size: 12px;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.keo-livesearch .sleyembed-card__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
}

.keo-livesearch .sleyembed-card__action {
  align-items: center;
  background: #0b6a55;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 5px;
  justify-content: center;
  line-height: 1;
  padding: 6px 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.keo-livesearch .sleyembed-card__action:hover,
.keo-livesearch .sleyembed-card__action:focus-visible {
  background: #084f3f;
  color: #fff;
  transform: translateY(-1px);
}

.keo-livesearch .sleyembed-action__icon {
  background: no-repeat center/contain;
  display: inline-block;
  flex: 0 0 12px;
  height: 12px;
  width: 12px;
}

.keo-livesearch .sleyembed-action__icon--details {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3h7v7'/%3E%3Cpath d='M10 14L21 3'/%3E%3Cpath d='M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5'/%3E%3C/svg%3E");
}

.keo-livesearch .sleyembed-action__label {
  line-height: 1;
}

@media (max-width: 640px) {
  .keo-livesearch-shortcode {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    margin: 20px auto;
  }

  .keo-livesearch-shortcode__form {
    width: 100%;
  }

  .keo-livesearch-shortcode__input[type="search"] {
    font-size: 22px;
    min-height: 72px;
    padding: 18px;
  }

  .keo-livesearch-shortcode__button {
    font-size: 16px;
    padding: 0 18px;
  }

  .keo-livesearch-shortcode__bubble {
    font-size: 14px;
    margin-bottom: 6px;
    width: 100%;
  }

  .keo-livesearch-shortcode__bubble::before,
  .keo-livesearch-shortcode__bubble::after {
    border-bottom: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    left: 32px;
    top: auto;
    transform: none;
  }

  .keo-livesearch-shortcode__bubble::before {
    border-top: 14px solid #d1d5db;
    bottom: -14px;
  }

  .keo-livesearch-shortcode__bubble::after {
    border-top: 13px solid #fff;
    bottom: -12px;
  }

  .keo-livesearch {
    border-radius: 6px;
    max-height: 72vh;
  }

  .keo-livesearch__groups {
    display: block;
  }

  .keo-livesearch__group + .keo-livesearch__group {
    margin-top: 8px;
  }
}
