/* Shared search input styles used across pages. */
.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-wrap input {
  padding-right: 34px;
}

.search-clear {
  position: absolute;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear.show {
  display: inline-flex;
}

.filter-hit {
  background: #fde68a;
  padding: 0 2px;
  border-radius: 4px;
}

.help-tip-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.help-tip-trigger {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.help-tip-trigger:hover,
.help-tip-trigger:focus-visible {
  opacity: 0.8;
}

.help-tip-trigger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 999px;
}

.help-tip-trigger[aria-expanded="true"] {
  transform: scale(1.04);
}

.help-tip-trigger svg {
  width: 14px;
  height: 14px;
  display: block;
}

.help-tip-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card, #ffffff);
  color: var(--text, #111827);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.help-tip-popover[hidden] {
  display: none;
}

.help-tip-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  left: var(--help-tip-arrow-left, 14px);
  width: 12px;
  height: 12px;
  background: inherit;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}

.modal-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  appearance: none;
  user-select: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: #f3f4f6;
}

.modal-close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.modal-close:active {
  transform: translateY(1px);
}

/* Global submit guard loader (POST actions). */
.btn.is-loading,
button.is-loading,
input[type="submit"].is-loading {
  opacity: 0.9;
  cursor: wait;
}

.btn.is-disabled,
a.btn.is-disabled {
  pointer-events: none;
  opacity: 0.68;
  cursor: wait;
}

.btn-submit-loader {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: btnSubmitSpin 0.7s linear infinite;
  margin-right: 8px;
  display: inline-block;
  flex: 0 0 13px;
}

.btn:not(.primary):not(.btn-primary) .btn-submit-loader {
  border-color: rgba(17, 24, 39, 0.28);
  border-top-color: rgba(17, 24, 39, 0.75);
}

@keyframes btnSubmitSpin {
  to {
    transform: rotate(360deg);
  }
}
