/* Modern-only floating AI chat */

.ish-ai-chat .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ish-ai-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000060;
  touch-action: none;
}

.ish-ai-chat.is-dragging {
  cursor: grabbing;
}

.ish-ai-chat-dragging,
.ish-ai-chat-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.ish-ai-chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.96), rgba(229, 9, 20, 0.88));
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: none;
}

.ish-ai-chat__launcher:hover {
  cursor: grab;
}

.ish-ai-chat.is-dragging .ish-ai-chat__launcher {
  cursor: grabbing;
}

.ish-ai-chat__panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: min(420px, calc(100vw - 24px));
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(10, 12, 18, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.ish-ai-chat__panel[hidden] {
  display: none !important;
}

.ish-ai-chat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: grab;
  touch-action: none;
}

.ish-ai-chat.is-dragging .ish-ai-chat__head {
  cursor: grabbing;
}

.ish-ai-chat__head strong {
  display: block;
  color: #fff;
  font-size: 14px;
}

.ish-ai-chat__head span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
}

.ish-ai-chat__close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
}

.ish-ai-chat__messages {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 420px;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ish-ai-chat__msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.ish-ai-chat__msg--user {
  align-self: flex-end;
  background: rgba(108, 99, 255, 0.24);
  color: #fff;
}

.ish-ai-chat__msg--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
}

.ish-ai-chat__msg--loading {
  opacity: 0.72;
  font-style: italic;
}

.ish-ai-chat__composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ish-ai-chat__composer input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
}

.ish-ai-chat__composer input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.ish-ai-chat__composer input:focus {
  outline: 2px solid rgba(108, 99, 255, 0.65);
  outline-offset: 1px;
}

.ish-ai-chat__composer button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(108, 99, 255, 0.88);
  color: #fff;
  cursor: pointer;
}

.ish-ai-chat__msg--results {
  max-width: 100%;
  padding: 0;
  background: transparent;
}

.ish-ai-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  max-width: 100%;
}

.ish-ai-chat__chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ish-ai-chat__chip:hover {
  background: rgba(108, 99, 255, 0.28);
  border-color: rgba(108, 99, 255, 0.5);
}

.ish-ai-chat__top-match {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 6px;
  padding-bottom: 4px;
  background: rgba(10, 12, 18, 0.98);
}

.ish-ai-chat__top-match-label {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ish-ai-chat__top-match-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.34), rgba(229, 9, 20, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  text-decoration: none;
  overflow: hidden;
}

.ish-ai-chat__top-match-card:not(:has(.ish-ai-chat__top-match-media)) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ish-ai-chat__top-match-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  min-height: 44px;
  max-height: 44px;
  overflow: hidden;
  border-radius: 999px;
  flex-shrink: 0;
}

.ish-ai-chat__top-match-media img {
  display: block;
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  min-height: 44px;
  max-height: 44px;
  object-fit: cover;
}

.ish-ai-chat__top-match-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ish-ai-chat__top-match-body strong {
  font-size: 13px;
}

.ish-ai-chat__top-match-body span,
.ish-ai-chat__top-match-body em {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.ish-ai-chat__top-match-body em {
  font-style: italic;
  opacity: 0.85;
}

.ish-ai-chat__top-match-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ish-ai-chat__team-cards {
  display: grid;
  gap: 8px;
}

.ish-ai-chat__team-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  text-decoration: none;
}

.ish-ai-chat__team-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  max-width: 52px;
  min-height: 52px;
  max-height: 52px;
  overflow: hidden;
  border-radius: 999px;
  flex-shrink: 0;
}

.ish-ai-chat__team-card-media img {
  display: block;
  width: 52px;
  height: 52px;
  min-width: 52px;
  max-width: 52px;
  min-height: 52px;
  max-height: 52px;
  object-fit: cover;
}

.ish-ai-chat__team-card-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ish-ai-chat__team-card-body strong {
  color: #fff;
  font-size: 12px;
}

.ish-ai-chat__team-card-body span,
.ish-ai-chat__team-card-body em {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  line-height: 1.35;
}

.ish-ai-chat__team-card-body em {
  font-style: italic;
}

.ish-ai-chat__results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ish-ai-chat__section--site-links {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px 8px;
  margin: 0 -4px;
  border-radius: 12px;
  background: rgba(10, 12, 18, 0.97);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.ish-ai-chat__section-title {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ish-ai-chat__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ish-ai-chat__pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.ish-ai-chat__links {
  display: grid;
  gap: 6px;
}

.ish-ai-chat__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-decoration: none;
}

.ish-ai-chat__link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ish-ai-chat__link-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.ish-ai-chat__link-title .fa-external-link {
  font-size: 10px;
  opacity: 0.65;
}

.ish-ai-chat__link-desc {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  line-height: 1.35;
}

.ish-ai-chat__pref-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(108, 99, 255, 0.28);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.ish-ai-chat__section--preferences .ish-ai-chat__link--preference {
  border: 1px solid rgba(108, 99, 255, 0.18);
}

.ish-ai-chat__top-match-body .ish-ai-chat__pref-badge {
  display: inline-flex;
  margin: 0 0 4px;
}

.ish-ai-chat__cards {
  display: grid;
  gap: 8px;
}

.ish-ai-chat__card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  text-decoration: none;
}

.ish-ai-chat__card-media {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
}

.ish-ai-chat__card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ish-ai-chat__card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ish-ai-chat__card-cat {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ish-ai-chat__card-title {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ish-ai-chat__count {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ish-ai-chat__more-wrap {
  margin-top: 10px;
}

.ish-ai-chat__more {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(108, 99, 255, 0.35);
  border-radius: 12px;
  background: rgba(108, 99, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.ish-ai-chat__more:hover:not(:disabled) {
  background: rgba(108, 99, 255, 0.2);
}

.ish-ai-chat__more:disabled,
.ish-ai-chat__more.is-loading {
  opacity: 0.72;
  cursor: wait;
}

body.ish-theme-modern.ish-modern-light .ish-ai-chat__panel,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__panel,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__panel {
  background: rgba(255, 250, 240, 0.98);
  border-color: rgba(17, 24, 39, 0.12);
}

body.ish-theme-modern.ish-modern-light .ish-ai-chat__section--site-links,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__section--site-links,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__section--site-links,
body.ish-theme-modern.ish-modern-light .ish-ai-chat__top-match,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__top-match,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__top-match {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

body.ish-theme-modern.ish-modern-light .ish-ai-chat__chip,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__chip,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__chip {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.82);
}

body.ish-theme-modern.ish-modern-light .ish-ai-chat__team-card-body strong,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__team-card-body strong,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__team-card-body strong,
body.ish-theme-modern.ish-modern-light .ish-ai-chat__top-match-body strong,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__top-match-body strong,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__top-match-body strong {
  color: rgba(0, 0, 0, 0.88);
}

body.ish-theme-modern.ish-modern-light .ish-ai-chat__section--site-links,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__section--site-links,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__section--site-links {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

body.ish-theme-modern.ish-modern-light .ish-ai-chat__head strong,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__head strong,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__head strong,
body.ish-theme-modern.ish-modern-light .ish-ai-chat__card-title,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__card-title,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__card-title,
body.ish-theme-modern.ish-modern-light .ish-ai-chat__link-title,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__link-title,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__link-title {
  color: #111827;
}

body.ish-theme-modern.ish-modern-light .ish-ai-chat__msg--bot,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__msg--bot,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__msg--bot {
  background: rgba(17, 24, 39, 0.06);
  color: #374151;
}

body.ish-theme-modern.ish-modern-light .ish-ai-chat__composer input,
body.ish-theme-modern.ish-modern-sepia .ish-ai-chat__composer input,
body.ish-theme-modern.ish-modern-contrast .ish-ai-chat__composer input {
  background: #fff;
  color: #111827;
  border-color: rgba(17, 24, 39, 0.12);
}

@media (max-width: 767px) {
  .ish-ai-chat {
    right: 12px;
    bottom: 12px;
  }

  .ish-ai-chat__panel {
    width: min(100vw - 24px, 420px);
  }
}
