html.algolia-open {
  overflow: hidden;
}

.algolia-modal[hidden] {
  display: none !important;
}

.algolia-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.algolia-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.algolia-panel {
  position: relative;
  width: min(860px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  margin: 10vh auto 0;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.algolia-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.algolia-input {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
}

.algolia-input:focus {
  border-color: rgba(0, 0, 0, 0.28);
}

.algolia-close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  cursor: pointer;
}

.algolia-body {
  padding: 14px;
  overflow: auto;
}

.algolia-status {
  display: none;
}

.algolia-results {
  display: grid;
  gap: 10px;
}

.algolia-hit {
  display: block;
  padding: 12px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  text-decoration: none;
}

.algolia-hit:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.algolia-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  margin-bottom: 6px;
  color: #111;
}

.algolia-meta {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 6px;
  color: #111;
}

.algolia-snippet {
  font-size: 14px;
  line-height: 1.4;
  color: #222;
  opacity: 0.92;
}

/* Algolia highlight tags often come back as <em> */
.algolia-snippet em,
.algolia-title em {
  font-style: normal;
  font-weight: 800;
  text-decoration: underline;
}

@media (max-width: 540px) {
  .algolia-panel {
    margin-top: 8vh;
    width: calc(100vw - 20px);
    max-height: 84vh;
    border-radius: 14px;
  }
}
