.auth-shell {
  max-width: 400px;
}

.is-hidden {
  display: none !important;
}

.form-slider {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.noUi-target {
  background: var(--bs-gray-300);
  border-radius: 10px;
  border: none;
  height: 6px;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.noUi-connect {
  background: var(--bs-primary);
}

.noUi-handle {
  cursor: pointer;
  width: 0 !important;
  height: 0 !important;
  right: 0 !important;
  top: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.noUi-handle.noUi-handle-lower .noUi-tooltip {
  left: 0;
  right: auto;
}

.noUi-handle.noUi-handle-upper .noUi-tooltip {
  left: auto;
  right: 0;
}

.noUi-handle:before,
.noUi-handle:after {
  display: none;
}

.noUi-tooltip {
  background: #007bff;
  color: #fff;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 5px;
}

.noUi-horizontal .noUi-tooltip {
  -webkit-transform: none;
  transform: none;
  left: auto;
  bottom: 0;
  transform: translateY(50%);
}

.was-validated .form-control:valid,
.was-validated .form-control:invalid,
.was-validated .form-select:valid,
.was-validated .form-select:invalid,
.was-validated .form-check-input:valid,
.was-validated .form-check-input:invalid,
.form-control.is-valid,
.form-control.is-invalid,
.form-select.is-valid,
.form-select.is-invalid,
.form-check-input.is-valid,
.form-check-input.is-invalid {
  background-image: none;
}

.was-validated .form-control:valid,
.was-validated .form-control:invalid,
.form-control.is-valid,
.form-control.is-invalid {
  padding-right: 0.75rem;
}

.was-validated .valid-feedback,
.valid-feedback {
  display: none !important;
}

.was-validated [data-field-control].is-invalid .invalid-feedback,
[data-field-control].is-invalid .invalid-feedback {
  display: block;
}

.was-validated .form-switch .form-check-input:valid,
.was-validated .form-switch .form-check-input:invalid,
.form-switch .form-check-input.is-valid,
.form-switch .form-check-input.is-invalid {
  border-color: var(--bs-border-color);
  background-image: var(--bs-form-switch-bg);
}

.was-validated .form-switch .form-check-input:checked:valid,
.was-validated .form-switch .form-check-input:checked:invalid,
.form-switch .form-check-input.is-valid:checked,
.form-switch .form-check-input.is-invalid:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.was-validated .form-switch .form-check-input:focus,
.form-switch .form-check-input.is-valid:focus,
.form-switch .form-check-input.is-invalid:focus {
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.was-validated .form-switch .form-check-input:valid ~ .form-check-label,
.was-validated .form-switch .form-check-input:invalid ~ .form-check-label,
.form-switch .form-check-input.is-valid ~ .form-check-label,
.form-switch .form-check-input.is-invalid ~ .form-check-label {
  color: inherit;
}



.is-form-loading {
  pointer-events: none;
  opacity: 0.85;
}

.search-editor-loading,
.search-matches-loading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 6rem;
}

.match-card-new {
  border-color: rgba(13, 110, 253, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
  background: linear-gradient(180deg, rgba(13, 110, 253, 0.06), rgba(255, 255, 255, 0) 4.5rem), #fff;
}

.match-card-new-badge {
  background: #0d6efd;
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100dvh;
}
body[data-page="chat"] {
  overflow: hidden;
}

body[data-page="chat"] #mainView {
  height: calc(var(--app-viewport-height, 100dvh) - var(--app-header-height, 0px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-shell {
  min-height: 0;
  height: 100%;
  display: flex;
}

.chat-main-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.chat-layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
}

.chat-sidebar {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: min(26rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
}

.chat-thread-list {
  gap: 0.75rem;
}



.chat-thread-link.active {
  background: #0d6efd;
  border-color: #0d6efd!important;
  color: #fff !important;
}

.chat-avatar,
.chat-avatar-placeholder {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
}

.chat-avatar {
  background: #0d6efd;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.chat-avatar-placeholder {
  background: rgba(148, 163, 184, 0.35);
}

.chat-main {
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.chat-main-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
}

.chat-message-list {
  padding: 1.5rem;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.chat-message-row.is-own {
  justify-content: flex-end;
}

.chat-message-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: min(78%, 38rem);
}

.chat-message-stack.is-own {
  align-items: flex-end;
}

.chat-bubble {
  width: 100%;
  max-width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 0.5rem 1rem 0.5rem 0rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-bubble.is-own {
  border-radius:  1rem 0.5rem 0rem 0.5rem;
  background: #0d6efd;
  color: #fff;
}

.chat-message-author {
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.chat-message-copy {
  white-space: pre-wrap;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-message-time {
  margin-top: 0.35rem;
  padding: 0 0.2rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

.chat-composer {
  background: rgba(255, 255, 255, 0.92);
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.chat-main-header,
.chat-composer,
#chatMessagesAlert {
  flex: 0 0 auto;
}

.chat-thread-summary {
  min-width: 0;
}

.chat-thread-title {
  font-weight: 700;
  line-height: 1.2;
}

.chat-thread-meta {
  margin-top: 0.2rem;
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

.chat-composer .input-group {
  align-items: stretch;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  overflow: hidden;
}

.chat-composer-input {
  resize: none;
  min-height: 3.5rem;
  padding: 0.5rem 1rem;
}

.chat-composer .btn {
  border-radius: 0;
}

.chat-empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--bs-secondary-color);
}

@media (max-width: 991.98px) {
  .chat-layout {
    min-height: 0;
  }

  .chat-message-list {
    max-height: none;
  }

  .chat-main-body {
    min-height: 0;
  }

  .chat-bubble {
    max-width: 100%;
  }

  .chat-message-stack {
    max-width: 86%;
  }
}

.matches-badges .badge {
  white-space: normal;
  font-weight: 500;
}

.search-map-field {
  min-height: 320px;
  margin-top: -1px;
  border: 1px solid var(--bs-border-color);
  border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
  overflow: hidden;
  background: var(--bs-light);
}

.search-map-shell {
  position: relative;
  margin-top: -1px;
}

.search-map-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 320px;
  border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  z-index: 20;
  color: var(--bs-body-color);
}

.search-map-loading.is-visible {
  display: flex;
}

.search-map-input-shell {
  position: relative;
}

.search-map-input-group {
  align-items: stretch;
}

.search-map-suggestions {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.search-map-suggestion-item {
  text-align: left;
}

.search-map-input-group .btn.is-loading {
  position: relative;
}

.search-map-validation-proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.maplibregl-map {
  font: inherit;
}

.maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show,
.maplibregl-ctrl-bottom-right {
  display: none !important;
}

.search-map-marker {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}
