/* v166: targeted main-site UX corrections after live customer-view audit. */

/* 1. Restore full use of the hero visual. Older density rules forced it to 104px. */
.v166-main-ux .hero-visual,
.v166-main-ux .hero-visual img {
  height: 100% !important;
  max-height: none !important;
}
.v166-main-ux .hero-visual img {
  object-fit: cover !important;
  object-position: center 52% !important;
}
.v166-main-ux .hero-card.active .hero-visual img {
  transform: scale(1.025) !important;
}

/* 2. Turn the repeated category introduction into a compact context strip. */
.v166-main-ux .preview-head {
  min-height: 68px !important;
  margin-bottom: 12px !important;
  padding: 12px 16px !important;
  display: grid !important;
  grid-template-columns: auto minmax(180px, max-content) minmax(0, 1fr) !important;
  align-items: center !important;
  column-gap: 12px !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 18px rgba(16, 36, 58, .05) !important;
}
.v166-main-ux .preview-head > span {
  margin: 0 !important;
  padding: 6px 9px !important;
  border-radius: 999px;
  background: #edf4fb;
  color: #245b8c !important;
  font-size: 9px !important;
  font-weight: 850;
  letter-spacing: .08em;
  white-space: nowrap;
}
.v166-main-ux .preview-head h2 {
  margin: 0 !important;
  font-size: clamp(17px, 1.45vw, 22px) !important;
  line-height: 1.1 !important;
  white-space: nowrap;
}
.v166-main-ux .preview-head p {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  color: #687789 !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 3. Give the chat identity and language controls their own stable row. */
.v166-main-ux .ai-panel > .dialog-head {
  min-height: 68px !important;
  height: auto !important;
  padding: 9px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  overflow: visible !important;
  background: #fff !important;
  border-bottom: 1px solid rgba(16, 36, 58, .10) !important;
}
.v166-main-ux .ai-panel > .dialog-head .bot {
  min-width: 0;
  flex: 1 1 auto;
}
.v166-main-ux .ai-panel > .dialog-head .bot > div {
  min-width: 0;
}
.v166-main-ux .ai-panel > .dialog-head .bot b {
  display: block !important;
  overflow: hidden;
  color: #102033 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v166-main-ux .ai-panel > .dialog-head .bot small {
  display: block !important;
  overflow: hidden;
  color: #728093 !important;
  font-size: 9px !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v166-main-ux .ai-panel > .dialog-head .lang-switch {
  flex: 0 0 auto;
  max-width: 61%;
  overflow-x: auto;
  scrollbar-width: none;
}
.v166-main-ux .ai-panel > .dialog-head .lang-switch::-webkit-scrollbar { display: none; }
.v166-main-ux .ai-panel > .dialog-head .lang-switch button {
  min-width: 30px !important;
  min-height: 28px !important;
  padding: 4px 6px !important;
}

/* 4. Make the content window read like a product workspace, not nested white cards. */
.v166-main-ux .preview-panel {
  padding: 12px !important;
}
.v166-main-ux .v160-category-landing {
  margin-top: 0 !important;
  border-color: rgba(16, 36, 58, .09) !important;
  box-shadow: 0 8px 24px rgba(16, 36, 58, .055) !important;
}
.v166-main-ux .v160-category-landing > header h2,
.v166-main-ux .v160-category-landing > header h3 {
  max-width: 640px;
  font-size: clamp(24px, 2.25vw, 36px) !important;
  line-height: 1.02 !important;
}

@media (max-width: 1080px) {
  .v166-main-ux .preview-head {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }
  .v166-main-ux .preview-head p { display: none; }
  .v166-main-ux .preview-head h2 { overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 760px) {
  .v166-main-ux .hero-visual,
  .v166-main-ux .hero-visual img { height: 150px !important; }
  .v166-main-ux .preview-head {
    min-height: 60px !important;
    padding: 10px 12px !important;
  }
  .v166-main-ux .preview-head h2 { font-size: 17px !important; white-space: normal; }
  .v166-main-ux .ai-panel > .dialog-head { min-height: 60px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .v166-main-ux .hero-card.active .hero-visual img { transform: none !important; }
}
