/* Barre de recherche du menu principal (/singularity) — recherche-menu.js */
.cats .rm {
  z-index: 40;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.4rem;
  padding-left: 1.3rem;
  border-left: 1px solid rgba(225, 6, 0, 0.45);
}
.rm-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(138, 128, 130, 0.45);
  background: transparent;
  color: #8a8082;
  cursor: pointer;
}
.rm-toggle:hover,
.rm-toggle:focus-visible,
.rm-toggle[aria-expanded="true"] { color: var(--rouge-texte, #f40700); border-color: #e10600; outline: none; }
.rm-field {
  position: relative;
  display: flex;
  align-items: center;
}
.rm-input {
  width: 11.5rem;
  padding: 0.3rem 1.8rem 0.3rem 0.1rem;
  border: 0;
  border-bottom: 1px solid rgba(138, 128, 130, 0.55);
  border-radius: 0;
  background: transparent;
  color: #f7f1f1;
  font-family: "Share Tech Mono", "Share Tech Mono Repli", ui-monospace, monospace;
  font-size: 15px;
  letter-spacing: 0.1em;
  line-height: 1.2;
  transition: width 0.25s ease, border-color 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}
.rm-input::placeholder { color: #8a8082; letter-spacing: 0.14em; opacity: 1; }
.rm-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.rm-input:focus { outline: none; width: 15rem; border-bottom-color: #e10600; }
.rm-key {
  position: absolute;
  right: 0.15rem;
  padding: 0 0.3rem;
  border: 1px solid rgba(138, 128, 130, 0.45);
  color: #8a8082;
  font: 11px/1.4 "Share Tech Mono", "Share Tech Mono Repli", ui-monospace, monospace;
  pointer-events: none;
}
.rm-input:focus + .rm-key,
.rm-input:not(:placeholder-shown) + .rm-key { display: none; }

.rm-panel {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  z-index: 60;
  width: min(30rem, 92vw);
  max-height: min(70vh, 34rem);
  overflow: auto;
  padding: 0.7rem 0 0.5rem;
  border: 1px solid rgba(225, 6, 0, 0.45);
  background: #080405;
  isolation: isolate;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65), 0 0 26px rgba(225, 6, 0, 0.18);
  font-family: "Share Tech Mono", "Share Tech Mono Repli", ui-monospace, monospace;
  text-align: left;
}
.rm-panel[hidden] { display: none; }
.rm-status {
  margin: 0 0.9rem 0.4rem;
  color: #b7aaa8;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.rm-status:empty { display: none; }
.rm-status.is-warn { color: #ff4d55; }
.rm-list { margin: 0; padding: 0; list-style: none; }
.rm-group {
  display: flex;
  justify-content: space-between;
  margin: 0.55rem 0 0.15rem;
  padding: 0.35rem 0.9rem 0.25rem;
  border-top: 1px solid rgba(225, 6, 0, 0.18);
  color: var(--rouge-texte, #f40700);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.rm-group:first-child { margin-top: 0; border-top: 0; }
.rm-count { color: #8a8082; letter-spacing: 0.1em; }
.rm-opt { margin: 0; cursor: pointer; }
.rm-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.9rem;
  color: inherit;
  text-decoration: none;
}
.rm-opt[aria-selected="true"] { background: rgba(225, 6, 0, 0.14); box-shadow: inset 2px 0 0 #e10600; }
.rm-thumb {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(138, 128, 130, 0.35);
  background: repeating-linear-gradient(135deg, rgba(225, 6, 0, 0.08) 0 4px, transparent 4px 8px);
}
.rm-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rm-thumb.is-kind,
.rm-thumb.is-adult {
  display: grid;
  place-items: center;
  color: #8a8082;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.rm-thumb.is-adult { border-color: rgba(225, 6, 0, 0.55); background: #000; color: #ff4d55; font-size: 12px; }
.rm-thumb.is-mark {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border-color: rgba(225, 6, 0, 0.55);
  background: rgba(225, 6, 0, 0.1);
  color: #ff4d55;
  font-size: 16px;
}
.rm-body { display: flex; flex-direction: column; min-width: 0; gap: 0.15rem; }
.rm-title {
  overflow: hidden;
  color: #f7f1f1;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-meta { display: flex; gap: 0.6rem; color: #8a8082; font-size: 11.5px; letter-spacing: 0.06em; }
.rm-lock { color: #ff4d55; letter-spacing: 0.12em; }
.rm-opt.is-more {
  padding: 0.4rem 0.9rem 0.4rem calc(0.9rem + 40px + 0.75rem);
  color: #b7aaa8;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.rm-opt.is-more[aria-selected="true"] { color: #ff4d55; }
.rm-foot {
  margin: 0.5rem 0.9rem 0;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(138, 128, 130, 0.2);
  color: #8a8082;
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* Mobile : la barre est repliée derrière une loupe en bout de menu ; ouverte, le champ et la liste se posent
   en surimpression sous le menu (la page ne bouge pas). Cibles tactiles de 44 px au moins. */
@media (max-width: 720px) {
  .cats { position: relative; z-index: 40; }
  .cats .rm { margin-left: 0; padding-left: 0; border-left: 0; position: static; }
  .rm-toggle { display: inline-flex; width: 44px; height: 44px; }
  .rm-field { display: none; }
  .rm-key, .rm-foot { display: none; }
  .rm.is-open .rm-field {
    display: flex;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 61;
    padding: 0 0.9rem;
    border: 1px solid rgba(225, 6, 0, 0.45);
    border-bottom: 0;
    background: #080405;
  }
  .rm.is-open .rm-input,
  .rm.is-open .rm-input:focus { width: 100%; min-height: 44px; font-size: 16px; padding-right: 0.2rem; }
  .rm-panel {
    top: calc(100% + 0.5rem + 45px);
    left: 0;
    right: 0;
    width: auto;
    max-height: 60dvh;
    border-top-color: rgba(225, 6, 0, 0.25);
  }
  .rm-link { min-height: 44px; }
  .rm-opt.is-more { display: flex; align-items: center; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .rm-input { transition: none; }
}
