/* Thream product-depth v2
   Mature social/product layout refinements for authenticated public surfaces.
   Dating intentionally keeps its own romantic visual system. */

html[data-thream-app="true"]:not([data-thream-route="/dating"]) {
  --product-radius: 14px;
  --product-radius-lg: 18px;
  --product-border: #e5e7eb;
  --product-muted: #667085;
  --product-shadow: 0 1px 2px rgba(15,23,42,.025), 0 6px 18px rgba(15,23,42,.035);
}

html[data-thream-app="true"]:not([data-thream-route="/dating"]) body {
  background: #f7f8fa !important;
}

html[data-thream-app="true"]:not([data-thream-route="/dating"]) main [class*="rounded-3xl"][class*="bg-white"],
html[data-thream-app="true"]:not([data-thream-route="/dating"]) main [class*="rounded-[26px]"][class*="bg-white"],
html[data-thream-app="true"]:not([data-thream-route="/dating"]) main [class*="rounded-[28px]"][class*="bg-white"] {
  border-radius: var(--product-radius-lg) !important;
  box-shadow: var(--product-shadow) !important;
}

html[data-thream-app="true"]:not([data-thream-route="/dating"]) main [class*="rounded-2xl"][class*="bg-white"] {
  border-radius: var(--product-radius) !important;
  box-shadow: var(--product-shadow) !important;
}

/* Discover — primary structural redesign */
html[data-thream-route="/discover"] body,
html[data-thream-route="/discover"] #root {
  background: #f7f8fa !important;
}

html[data-thream-route="/discover"] main > div > section:first-child,
html[data-thream-route="/discover"] [data-thream-mobile-shell] header {
  border-color: #e5e7eb !important;
  background: rgba(255,255,255,.98) !important;
  box-shadow: none !important;
}

@media (min-width: 768px) {
  html[data-thream-route="/discover"] main > div > section:first-child {
    border-radius: 14px !important;
    padding: 18px 20px !important;
  }
}

html[data-thream-route="/discover"] main > div > section:first-child h1 {
  font-size: 24px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  letter-spacing: -.025em !important;
}

html[data-thream-route="/discover"] main > div > section:first-child p {
  color: #667085 !important;
}

html[data-thream-route="/discover"] main > div > section:first-child [class*="bg-slate-100"][class*="rounded-xl"] {
  border: 1px solid #e5e7eb;
  background: #f8fafc !important;
  border-radius: 10px !important;
}

html[data-thream-route="/discover"] main > div > section:first-child [class*="bg-slate-100"][class*="rounded-xl"] button {
  border-radius: 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

html[data-thream-route="/discover"] input,
html[data-thream-route="/discover"] select {
  border-radius: 10px !important;
}

html[data-thream-route="/discover"] main > div > section:first-child button[class*="rounded-xl"],
html[data-thream-route="/discover"] main > div > section:first-child label[class*="rounded-xl"] {
  border-radius: 10px !important;
}

html[data-thream-route="/discover"] main > div > section:nth-of-type(2) {
  border-color: #dbe5f5 !important;
  border-radius: 12px !important;
  background: #f7faff !important;
  box-shadow: none !important;
  padding: 13px 15px !important;
}

@media (min-width: 1024px) {
  html[data-thream-route="/discover"] main.grid,
  html[data-thream-route="/discover"] div > main.grid {
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    gap: 16px !important;
  }
}

@media (min-width: 1536px) {
  html[data-thream-route="/discover"] main.grid,
  html[data-thream-route="/discover"] div > main.grid {
    grid-template-columns: repeat(4, minmax(0,1fr)) !important;
  }
}

html[data-thream-route="/discover"] main.grid > article,
html[data-thream-route="/discover"] section > article {
  border-radius: 14px !important;
  border-color: #e4e7ec !important;
  box-shadow: 0 1px 2px rgba(16,24,40,.025), 0 5px 16px rgba(16,24,40,.035) !important;
  background: #fff !important;
}

html[data-thream-route="/discover"] main.grid > article:hover {
  transform: translateY(-1px) !important;
  border-color: #cfd8e6 !important;
  box-shadow: 0 7px 22px rgba(16,24,40,.07) !important;
}

@media (min-width: 768px) {
  html[data-thream-route="/discover"] main.grid > article > div:first-child {
    height: 190px !important;
  }
}

html[data-thream-route="/discover"] main.grid > article > div:last-child {
  padding: 14px !important;
}

html[data-thream-route="/discover"] main.grid > article button[class*="text-[14px]"],
html[data-thream-route="/discover"] main.grid > article button[class*="text-[15px]"] {
  font-size: 15px !important;
  line-height: 1.3 !important;
  font-weight: 650 !important;
}

html[data-thream-route="/discover"] main.grid > article p[class*="text-[9px]"] {
  font-size: 11px !important;
  line-height: 1.45 !important;
}

html[data-thream-route="/discover"] main.grid > article [class*="text-[8px]"] {
  font-size: 10px !important;
  line-height: 1.4 !important;
}

html[data-thream-route="/discover"] main.grid > article [class*="text-[9px]"] {
  font-size: 10.5px !important;
}

html[data-thream-route="/discover"] main.grid > article [class*="rounded-md"] {
  border-radius: 6px !important;
}

html[data-thream-route="/discover"] main.grid > article [class*="grid-cols-[1fr_42px]"] {
  gap: 8px !important;
  margin-top: 12px !important;
}

html[data-thream-route="/discover"] main.grid > article button[class*="min-h-9"],
html[data-thream-route="/discover"] main.grid > article [class*="min-h-9"] {
  min-height: 40px !important;
  border-radius: 9px !important;
}

/* Discover profile preview — compact desktop layout; prevent the empty white-sheet effect. */
html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] {
  width: min(920px, calc(100vw - 48px)) !important;
  max-width: 920px !important;
  max-height: min(760px, calc(100dvh - 56px)) !important;
  border-radius: 24px !important;
}

html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] > div.grid {
  grid-template-columns: 300px minmax(0, 1fr) !important;
  max-height: min(760px, calc(100dvh - 56px)) !important;
}

html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] > div.grid > aside {
  min-height: 560px !important;
}

html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] > div.grid > div:last-child {
  max-height: min(760px, calc(100dvh - 56px)) !important;
}

html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] > div.grid > div:last-child > div:first-child {
  padding: 26px 28px 20px !important;
}

html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] > div.grid > div:last-child > div:last-child {
  position: sticky !important;
  bottom: 0 !important;
  padding: 16px 28px 20px !important;
  background: rgba(255,255,255,.97) !important;
  backdrop-filter: blur(14px);
}

@media (max-width: 767px) {
  html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] {
    width: 100% !important;
    max-width: none !important;
    max-height: 92dvh !important;
    border-radius: 28px 28px 0 0 !important;
  }

  html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] > div.grid {
    grid-template-columns: 1fr !important;
    max-height: 92dvh !important;
  }

  html[data-thream-route="/discover"] [role="dialog"][aria-modal="true"][aria-label$=" profile"] > div.grid > aside {
    min-height: 230px !important;
    height: 230px !important;
  }
}

@media (max-width: 767px) {
  html[data-thream-route="/discover"] [data-thream-mobile-shell] header h1 {
    font-size: 23px !important;
    font-weight: 700 !important;
  }

  html[data-thream-route="/discover"] [data-thream-mobile-shell] section.grid.grid-cols-4 button {
    border-radius: 13px !important;
    padding: 10px 7px !important;
  }

  html[data-thream-route="/discover"] [data-thream-mobile-shell] article {
    border-radius: 14px !important;
    padding: 14px !important;
    box-shadow: 0 1px 2px rgba(16,24,40,.02), 0 4px 14px rgba(16,24,40,.035) !important;
  }

  html[data-thream-route="/discover"] [data-thream-mobile-shell] article img {
    border-radius: 12px !important;
  }

  html[data-thream-route="/discover"] [data-thream-mobile-shell] article [class*="rounded-2xl"][class*="bg-slate-50"] {
    border-radius: 10px !important;
    background: #f8fafc !important;
  }
}

/* Connections */
html[data-thream-route="/connections"] .thream-card-premium {
  border-radius: 14px !important;
  box-shadow: none !important;
  border-color: #e4e7ec !important;
  padding: 20px !important;
}

html[data-thream-route="/connections"] .thream-card-premium h1 {
  font-size: 26px !important;
  font-weight: 700 !important;
}

html[data-thream-route="/connections"] .thream-card {
  border-radius: 14px !important;
  box-shadow: var(--product-shadow) !important;
}

html[data-thream-route="/connections"] article img {
  border-radius: 12px !important;
}

html[data-thream-route="/connections"] article button,
html[data-thream-route="/connections"] aside button {
  border-radius: 9px !important;
}

html[data-thream-route="/connections"] article [class*="rounded-full"] {
  border-radius: 999px !important;
}

@media (min-width: 1024px) {
  html[data-thream-route="/connections"] .grid.lg\:grid-cols-\[220px_minmax\(0\,1fr\)_280px\] {
    grid-template-columns: 190px minmax(0,1fr) 250px !important;
    gap: 18px !important;
  }
}

/* Messages */
html[data-thream-route="/messages"] main [class*="rounded-2xl"],
html[data-thream-route="/messages"] main [class*="rounded-3xl"] {
  border-radius: 12px !important;
}

html[data-thream-route="/messages"] main [class*="shadow-"] {
  box-shadow: 0 1px 2px rgba(16,24,40,.025), 0 4px 14px rgba(16,24,40,.03) !important;
}

html[data-thream-route="/messages"] textarea,
html[data-thream-route="/messages"] input {
  border-radius: 10px !important;
}

html[data-thream-route="/messages"] button[class*="rounded-full"] {
  box-shadow: none !important;
}

/* Profile */
html[data-thream-route="/profile"] main [class*="rounded-3xl"],
html[data-thream-route="/profile"] main [class*="rounded-[28px]"] {
  border-radius: 16px !important;
}

html[data-thream-route="/profile"] main h1 {
  font-size: clamp(25px,2.2vw,31px) !important;
  font-weight: 700 !important;
}

html[data-thream-route="/profile"] main [class*="shadow-"] {
  box-shadow: var(--product-shadow) !important;
}

/* Settings */
html[data-thream-route="/settings"] main [class*="rounded-2xl"],
html[data-thream-route="/settings"] main [class*="rounded-3xl"] {
  border-radius: 12px !important;
  box-shadow: none !important;
}

html[data-thream-route="/settings"] main section {
  border-color: #e4e7ec !important;
}

html[data-thream-route="/settings"] main h1,
html[data-thream-route="/settings"] main h2 {
  font-weight: 700 !important;
}

/* Home / Campus */
html[data-thream-route="/intention"] .campus-home-hero,
html[data-thream-route="/campusboard"] .campus-home-hero {
  border-radius: 14px !important;
  box-shadow: none !important;
  border-color: #e4e7ec !important;
}

html[data-thream-route="/intention"] main article,
html[data-thream-route="/campusboard"] main article {
  border-radius: 14px !important;
  box-shadow: var(--product-shadow) !important;
}

html[data-thream-app="true"]:not([data-thream-route="/dating"]) main input,
html[data-thream-app="true"]:not([data-thream-route="/dating"]) main textarea,
html[data-thream-app="true"]:not([data-thream-route="/dating"]) main select {
  border-radius: 10px !important;
}

html[data-thream-app="true"]:not([data-thream-route="/dating"]) main button[class*="rounded-xl"] {
  border-radius: 9px !important;
}

html[data-thream-app="true"]:not([data-thream-route="/dating"]) main [class*="rounded-full"] {
  border-radius: 999px !important;
}
