/**
 * ORA Explore Hub — NVIDIA Build–inspired catalog UI
 * Models · Skills · Blueprints · Learn
 */

/* ─── Page shell ─── */
[data-explore] {
  --xp-card-min: 280px;
  --xp-sidebar: 240px;
}
[data-explore] .mesh,
[data-explore] .grain {
  pointer-events: none;
}
[data-explore] main {
  position: relative;
  z-index: 2;
}
[data-explore] .feature {
  padding: 24px 0 80px;
}
[data-explore] .xp-hero {
  padding: calc(var(--nav-h) + 32px) 0 28px;
}
[data-explore] .xp-hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  letter-spacing: -0.02em;
}
[data-explore] .reveal,
[data-explore] .xp-grid .xp-card,
[data-explore] .xp-grid.reveal {
  opacity: 1;
  transform: none;
}
[data-explore] .page-tag {
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.08);
}
[data-explore] .xp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
[data-explore] .xp-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.024)),
    radial-gradient(420px 150px at 50% -60%, rgba(34, 211, 238, 0.16), transparent 68%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
[data-explore] .xp-stat::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.6), transparent);
}
[data-explore] .xp-stat strong {
  display: block;
  font-size: clamp(1.65rem, 3.4vw, 2.45rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: #73b8ff;
  text-shadow: 0 0 26px rgba(73, 163, 255, 0.32);
}
[data-explore] .xp-stat span {
  display: block;
  color: rgba(236, 244, 255, 0.76);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
}
[data-explore] .xp-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
[data-explore] .xp-chart-card {
  min-width: 0;
  min-height: 254px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.018)),
    radial-gradient(560px 240px at 30% 0%, rgba(167, 139, 250, 0.12), transparent 70%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
[data-explore] .xp-chart-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.1), transparent 32%),
    radial-gradient(220px 120px at 82% 14%, rgba(34, 211, 238, 0.11), transparent 70%);
  opacity: 0.65;
}
[data-explore] .xp-chart-card h4 {
  position: relative;
  z-index: 1;
  color: rgba(236, 244, 255, 0.74);
  letter-spacing: 0.09em;
}
[data-explore] .xp-chart-card canvas {
  width: 100%;
  max-width: 100%;
  height: 172px;
  position: relative;
  z-index: 1;
  cursor: crosshair;
}
.xp-chart-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: grid;
  gap: 3px;
  min-width: 128px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #f8fbff;
  background: rgba(7, 10, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(34, 211, 238, 0.08);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition: opacity 120ms var(--ease), transform 120ms var(--ease);
}
.xp-chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.xp-chart-tooltip strong {
  font-size: 0.78rem;
}
.xp-chart-tooltip span {
  color: rgba(236, 244, 255, 0.68);
  font-size: 0.72rem;
}

/* ─── Catalog layout (models) ─── */
.xp-catalog-wrap {
  display: grid;
  grid-template-columns: var(--xp-sidebar) 1fr;
  gap: 28px;
  align-items: start;
}
.xp-catalog-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 12px);
  padding: 20px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(8, 10, 18, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}
.xp-sidebar-title {
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
}
.xp-catalog-sidebar .xp-filters {
  flex-direction: column;
  align-items: stretch;
}
.xp-catalog-sidebar .xp-filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-radius: 10px;
  width: 100%;
}
.xp-catalog-sidebar .xp-filter-btn span {
  color: var(--fg-mute);
  font-size: 0.74rem;
  font-weight: 600;
}
.xp-catalog-sidebar .xp-filter-group + .xp-filter-group {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.xp-filter-group-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  margin-bottom: 8px;
}
.xp-catalog-body {
  min-width: 0;
}
.xp-catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.022));
  border: 1px solid rgba(167, 139, 250, 0.24);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}
.xp-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.xp-sort-label {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--fg-mute);
}
.xp-sort {
  min-height: 40px;
  padding: 0 34px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.86rem;
}
.xp-catalog-toolbar .xp-search {
  width: 100%;
  min-width: 0;
  padding: 12px 16px;
  font-size: 1rem;
}
.xp-result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.xp-result-bar .xp-micro {
  margin: 0;
  font-size: 0.85rem;
}
.xp-result-hint {
  font-size: 0.78rem;
  color: var(--fg-mute);
}

/* ─── Model grid (NVIDIA-style cards) ─── */
.xp-model-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--xp-card-min)), 1fr));
  gap: 14px;
}
.xp-model-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.066) 0%, rgba(255, 255, 255, 0.018) 54%, rgba(34, 211, 238, 0.035) 100%),
    rgba(9, 12, 22, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.105);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.065);
  cursor: pointer;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease);
}
.xp-model-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 34%);
  opacity: 0.38;
}
.xp-model-card:hover,
.xp-model-card:focus-visible {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(34, 211, 238, 0.16), 0 0 42px rgba(34, 211, 238, 0.1);
  transform: translateY(-3px);
  outline: none;
}
.xp-model-card__body {
  flex: 1;
  padding: 18px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.xp-model-card__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.xp-model-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, #76b900 0%, #22d3ee 100%);
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.25);
}
.xp-model-card__icon--logo {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24), 0 0 0 4px rgba(255, 255, 255, 0.035);
  overflow: hidden;
}
.xp-model-card__icon--logo img {
  width: 27px;
  height: 27px;
  object-fit: contain;
  display: block;
}
.xp-model-card__icon--logo span {
  color: #0b0f1a;
}
.xp-model-card__icon--meta { background: linear-gradient(135deg, #0668e1, #a78bfa); }
.xp-model-card__icon--nvidia { background: linear-gradient(135deg, #76b900, #5a8f00); }
.xp-model-card__icon--openai { background: linear-gradient(135deg, #10a37f, #1a7f64); }
.xp-model-card__icon--anthropic { background: linear-gradient(135deg, #d4a574, #c45c26); }
.xp-model-card__icon--logo,
.xp-model-card__icon--logo.xp-model-card__icon--meta,
.xp-model-card__icon--logo.xp-model-card__icon--nvidia,
.xp-model-card__icon--logo.xp-model-card__icon--openai,
.xp-model-card__icon--logo.xp-model-card__icon--anthropic {
  background: rgba(255, 255, 255, 0.98);
}
.xp-model-card__meta { min-width: 0; flex: 1; }
.xp-model-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}
.xp-model-card__sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--fg-mute);
}
.xp-model-card__desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--fg-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.xp-model-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.xp-badge--download {
  background: rgba(118, 185, 0, 0.12);
  color: #8bd41f;
}
.xp-model-card__foot {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}
.xp-model-card__foot .xp-btn-ora {
  flex: 1;
  justify-content: center;
  font-size: 0.8rem;
  padding: 9px 12px;
}
.xp-model-card__foot .xp-btn-ghost {
  flex-shrink: 0;
  padding: 9px 12px;
  font-size: 0.78rem;
}

/* Shared buttons */
.xp-btn-ora {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: #0b0f1a;
  background: linear-gradient(135deg, #9fa8ff 0%, #24d4f4 100%);
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.18);
  border: none;
  cursor: pointer;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.xp-btn-ora:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.xp-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--fg-dim);
  background: transparent;
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: border-color 180ms, color 180ms;
}
.xp-btn-ghost:hover {
  color: var(--fg);
  border-color: rgba(167, 139, 250, 0.45);
}

/* ─── Detail drawer (NVIDIA model page style) ─── */
body.xp-detail-open {
  overflow: hidden;
}
.xp-detail-backdrop {
  backdrop-filter: blur(4px);
}
.xp-detail {
  width: min(560px, 100vw);
  display: flex;
  flex-direction: column;
}
.xp-detail-inner {
  flex: 1;
  padding: 56px 24px 24px;
  overflow-y: auto;
}
.xp-detail-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.xp-detail-hero .xp-model-card__icon {
  width: 56px;
  height: 56px;
  font-size: 1.35rem;
  border-radius: 14px;
}
.xp-detail-hero .xp-model-card__icon img {
  width: 36px;
  height: 36px;
}
.xp-detail-hero h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  line-height: 1.2;
}
.xp-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.xp-detail-desc {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--fg-dim);
  margin: 0 0 20px;
}
.xp-detail-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.xp-detail-section:last-of-type {
  border-bottom: 0;
}
.xp-detail-sticky-foot {
  flex-shrink: 0;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid rgba(167, 139, 250, 0.25);
  background: rgba(8, 10, 18, 0.95);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
html[data-theme="light"] .xp-detail-sticky-foot {
  background: rgba(255, 255, 255, 0.96);
}
.xp-detail-sticky-foot .xp-btn-ora {
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
  font-size: 0.95rem;
}
.xp-detail-sticky-foot .xp-detail-foot-row {
  display: flex;
  gap: 8px;
}
.xp-detail-sticky-foot .xp-btn-ghost {
  flex: 1;
  justify-content: center;
}
.xp-src-btn--nvidia {
  background: rgba(118, 185, 0, 0.12);
  border-color: rgba(118, 185, 0, 0.4);
}

/* ─── Skills / Blueprints / Learn cards ─── */
.xp-skill-card,
.xp-bp-card,
.xp-learn-card {
  display: flex;
  flex-direction: column;
  min-height: 180px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: border-color 200ms, transform 200ms;
}
.xp-skill-card:hover,
.xp-bp-card:hover,
.xp-learn-card:hover {
  border-color: rgba(167, 139, 250, 0.35);
  transform: translateY(-2px);
}
.xp-skill-card h3,
.xp-bp-card h3,
.xp-learn-card h3 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.xp-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

/* ─── Explore hub cards ─── */
.xp-discover-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 30px;
  margin-top: 28px;
}
.xp-discover-nav {
  position: sticky;
  top: calc(var(--nav-h) + 12px);
  align-self: start;
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(10, 9, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.105);
  box-shadow: 0 24px 75px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}
.xp-discover-nav h2 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
}
.xp-discover-nav a {
  display: block;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 0.9rem;
}
.xp-discover-nav a:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.16);
}
.xp-discover-main {
  min-width: 0;
}
.xp-discover-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 24px 0;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid rgba(34, 211, 238, 0.26);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(167, 139, 250, 0.07)),
    rgba(8, 13, 24, 0.76);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.xp-discover-band h2,
.xp-section-head h2 {
  margin: 8px 0 6px;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}
.xp-discover-band p,
.xp-section-head p {
  margin: 0;
  max-width: 720px;
  color: var(--fg-dim);
  line-height: 1.6;
}
.xp-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 14px;
}
.xp-featured-grid {
  margin-bottom: 28px;
}
.xp-knowledge-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.xp-knowledge-card {
  position: relative;
  min-height: 180px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
  color: inherit;
  text-decoration: none;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}
.xp-knowledge-card:hover {
  border-color: rgba(34, 211, 238, 0.34);
  transform: translateY(-2px);
}
.xp-knowledge-card .xp-read {
  position: absolute;
  right: 18px;
  top: 18px;
}
.xp-knowledge-card h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}
.xp-knowledge-card p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 0.86rem;
  line-height: 1.55;
}
.xp-model-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.xp-model-summary div {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
}
.xp-model-summary strong {
  display: block;
  font-size: 1.35rem;
  font-family: var(--font-display);
}
.xp-model-summary span {
  display: block;
  margin-top: 4px;
  color: var(--fg-mute);
  font-size: 0.8rem;
}
.xp-hub-grid {
  gap: 14px;
  margin-top: 28px;
  margin-bottom: 20px;
}
.xp-hub-card {
  min-height: 160px;
  border-radius: 16px;
  padding: 22px;
}
.xp-hub-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: rgba(167, 139, 250, 0.15);
  margin-bottom: 4px;
}

/* ─── Charts compact on catalog pages ─── */
.xp-charts--compact {
  margin: 16px 0 24px;
}
.xp-charts--compact .xp-chart-card {
  padding: 18px;
}
.xp-charts--compact canvas {
  height: 172px;
}

/* ─── Mobile ─── */
@media (max-width: 900px) {
  .xp-catalog-wrap {
    grid-template-columns: 1fr;
  }
  .xp-catalog-sidebar {
    position: static;
    display: none;
  }
  .xp-catalog-sidebar.is-mobile-open {
    display: block;
  }
  .xp-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    appearance: none;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-2);
  }
  .xp-catalog-toolbar {
    position: sticky;
    top: calc(var(--nav-h) + 4px);
    z-index: 15;
    backdrop-filter: blur(14px);
  }
  .xp-toolbar-row {
    flex-wrap: wrap;
  }
  .xp-sort-label {
    margin-left: 0;
  }
  .xp-sort {
    flex: 1;
  }
  .xp-discover-layout {
    grid-template-columns: 1fr;
  }
  .xp-discover-nav {
    position: static;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  .xp-discover-nav h2 {
    display: none;
  }
  .xp-discover-nav a {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .xp-discover-band,
  .xp-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .xp-model-summary {
    grid-template-columns: 1fr;
  }
  .xp-catalog-toolbar .xp-filters--mobile {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .xp-catalog-toolbar .xp-filters--mobile::-webkit-scrollbar {
    display: none;
  }
  .xp-catalog-toolbar .xp-filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .xp-model-grid {
    grid-template-columns: 1fr;
  }
  .xp-detail {
    width: 100vw;
    max-width: 100vw;
  }
  .xp-detail-inner {
    padding: 52px 18px 16px;
  }
  .xp-bp-layout {
    gap: 16px;
  }
  .xp-bp-aside {
    order: -1;
  }
  [data-explore] .xp-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  [data-explore] .xp-charts {
    grid-template-columns: 1fr;
  }
  .xp-hub-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) {
  .xp-filter-toggle {
    display: none;
  }
  .xp-catalog-toolbar .xp-filters--mobile {
    display: none;
  }
}

@media (min-width: 1200px) {
  [data-explore="models"] {
    --xp-card-min: 300px;
  }
  .xp-model-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Light theme — premium white-glass system for Explore/Models.
   These rules intentionally live here because explore.css loads after styles.css. */
html[data-theme="light"][data-explore],
html[data-theme="light"] body[data-explore] {
  --xp-ink: #16161d;
  --xp-muted: #5f6472;
  --xp-subtle: #7b8190;
  --xp-surface: rgba(255, 255, 255, 0.86);
  --xp-surface-strong: rgba(255, 255, 255, 0.94);
  --xp-hairline: rgba(30, 41, 59, 0.10);
  --xp-hairline-strong: rgba(124, 58, 237, 0.18);
  --xp-shadow: 0 1px 1px rgba(15, 23, 42, 0.035),
    0 22px 62px -34px rgba(30, 41, 59, 0.30);
  --xp-shadow-hover: 0 1px 2px rgba(15, 23, 42, 0.05),
    0 32px 74px -34px rgba(79, 70, 229, 0.32);
}

html[data-theme="light"] [data-explore] .xp-stat,
html[data-theme="light"] [data-explore] .xp-chart-card,
html[data-theme="light"] [data-explore] .xp-catalog-sidebar,
html[data-theme="light"] [data-explore] .xp-catalog-toolbar,
html[data-theme="light"] [data-explore] .xp-discover-nav,
html[data-theme="light"] [data-explore] .xp-discover-band,
html[data-theme="light"] [data-explore] .xp-model-card,
html[data-theme="light"] [data-explore] .xp-skill-card,
html[data-theme="light"] [data-explore] .xp-bp-card,
html[data-theme="light"] [data-explore] .xp-learn-card,
html[data-theme="light"] [data-explore] .xp-knowledge-card,
html[data-theme="light"] [data-explore] .xp-model-summary div,
html[data-theme="light"] [data-explore] .xp-hub-card,
html[data-theme="light"] [data-explore] .xp-learn-reader {
  color: var(--xp-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.78)),
    radial-gradient(520px 220px at 20% -20%, rgba(124, 58, 237, 0.08), transparent 68%),
    var(--xp-surface);
  border-color: var(--xp-hairline);
  box-shadow: var(--xp-shadow);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

html[data-theme="light"] [data-explore] .xp-model-card:hover,
html[data-theme="light"] [data-explore] .xp-model-card:focus-visible,
html[data-theme="light"] [data-explore] .xp-skill-card:hover,
html[data-theme="light"] [data-explore] .xp-bp-card:hover,
html[data-theme="light"] [data-explore] .xp-learn-card:hover,
html[data-theme="light"] [data-explore] .xp-knowledge-card:hover,
html[data-theme="light"] [data-explore] .xp-hub-card:hover {
  border-color: rgba(8, 145, 178, 0.24);
  box-shadow: var(--xp-shadow-hover);
}

html[data-theme="light"] [data-explore] .xp-stat::after,
html[data-theme="light"] [data-explore] .xp-chart-card::before,
html[data-theme="light"] [data-explore] .xp-model-card::before {
  opacity: 0.38;
}

html[data-theme="light"] [data-explore] .xp-stat strong {
  color: transparent;
  background: linear-gradient(135deg, #2563eb 0%, #0891b2 48%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}

html[data-theme="light"] [data-explore] .xp-stat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 255, 0.88)),
    radial-gradient(380px 150px at 50% -45%, rgba(14, 165, 233, 0.13), transparent 68%),
    var(--xp-surface-strong);
  border-color: rgba(124, 58, 237, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.86) inset,
    0 18px 44px -34px rgba(15, 23, 42, 0.42);
}

html[data-theme="light"] [data-explore] .xp-stat span {
  color: #525866;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] [data-explore] .xp-chart-card h4,
html[data-theme="light"] [data-explore] .xp-sidebar-title,
html[data-theme="light"] [data-explore] .xp-filter-group-label,
html[data-theme="light"] [data-explore] .xp-discover-nav h2 {
  color: #737987;
}

html[data-theme="light"] [data-explore] .xp-chart-card canvas {
  filter: saturate(1.08) contrast(1.03);
}

html[data-theme="light"] [data-explore] .xp-catalog-sidebar,
html[data-theme="light"] [data-explore] .xp-discover-nav {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.86)),
    rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] [data-explore] .xp-catalog-sidebar .xp-filter-btn,
html[data-theme="light"] [data-explore] .xp-filter-btn,
html[data-theme="light"] [data-explore] .xp-sort,
html[data-theme="light"] [data-explore] .xp-search {
  color: var(--xp-muted);
  background: rgba(248, 250, 252, 0.82);
  border-color: rgba(30, 41, 59, 0.10);
}

html[data-theme="light"] [data-explore] .xp-catalog-sidebar .xp-filter-btn span {
  color: var(--xp-subtle);
}

html[data-theme="light"] [data-explore] .xp-filter-btn.is-active,
html[data-theme="light"] [data-explore] .xp-filter-btn:hover {
  color: var(--xp-ink);
  border-color: rgba(8, 145, 178, 0.34);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(8, 145, 178, 0.07)), #ffffff;
  box-shadow: 0 10px 28px -22px rgba(8, 145, 178, 0.45);
}

html[data-theme="light"] [data-explore] .xp-discover-nav a {
  color: var(--xp-muted);
}

html[data-theme="light"] [data-explore] .xp-discover-nav a:hover {
  color: var(--xp-ink);
  background: rgba(124, 58, 237, 0.07);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.10);
}

html[data-theme="light"] [data-explore] .xp-discover-band {
  background:
    linear-gradient(135deg, rgba(8, 145, 178, 0.13), rgba(124, 58, 237, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.82));
  border-color: rgba(8, 145, 178, 0.22);
}

html[data-theme="light"] [data-explore] .xp-discover-band p,
html[data-theme="light"] [data-explore] .xp-section-head p,
html[data-theme="light"] [data-explore] .xp-card-desc,
html[data-theme="light"] [data-explore] .xp-detail-desc,
html[data-theme="light"] [data-explore] .xp-knowledge-card p,
html[data-theme="light"] [data-explore] .xp-hub-card p,
html[data-theme="light"] [data-explore] .xp-learn-reader p,
html[data-theme="light"] [data-explore] .xp-steps,
html[data-theme="light"] [data-explore] .xp-list {
  color: var(--xp-muted);
}

html[data-theme="light"] [data-explore] .xp-model-card {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.88) 58%, rgba(8, 145, 178, 0.055) 100%),
    #ffffff;
}

html[data-theme="light"] [data-explore] .xp-model-card__foot {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.66), rgba(241, 245, 249, 0.88));
  border-top-color: rgba(30, 41, 59, 0.08);
}

html[data-theme="light"] [data-explore] .xp-model-card__title,
html[data-theme="light"] [data-explore] .xp-card-title,
html[data-theme="light"] [data-explore] .xp-knowledge-card h3,
html[data-theme="light"] [data-explore] .xp-hub-card h3,
html[data-theme="light"] [data-explore] .xp-detail h2,
html[data-theme="light"] [data-explore] .xp-detail h4,
html[data-theme="light"] [data-explore] .xp-section-head h2,
html[data-theme="light"] [data-explore] .xp-discover-band h2 {
  color: var(--xp-ink);
}

html[data-theme="light"] [data-explore] .xp-model-card__sub,
html[data-theme="light"] [data-explore] .xp-micro,
html[data-theme="light"] [data-explore] .xp-read,
html[data-theme="light"] [data-explore] .xp-result-hint,
html[data-theme="light"] [data-explore] .xp-detail-provider,
html[data-theme="light"] [data-explore] .xp-card-provider,
html[data-theme="light"] [data-explore] .xp-model-summary span {
  color: var(--xp-subtle);
}

html[data-theme="light"] [data-explore] .xp-badge {
  background: rgba(15, 23, 42, 0.045);
  color: #64748b;
}

html[data-theme="light"] [data-explore] .xp-badge--local,
html[data-theme="light"] [data-explore] .xp-badge--basics {
  background: rgba(8, 145, 178, 0.10);
  color: #0e7490;
}

html[data-theme="light"] [data-explore] .xp-badge--cloud,
html[data-theme="light"] [data-explore] .xp-badge--intermediate {
  background: rgba(124, 58, 237, 0.10);
  color: #6d28d9;
}

html[data-theme="light"] [data-explore] .xp-badge--hybrid,
html[data-theme="light"] [data-explore] .xp-badge--advanced {
  background: rgba(219, 39, 119, 0.10);
  color: #be185d;
}

html[data-theme="light"] [data-explore] .xp-badge--free,
html[data-theme="light"] [data-explore] .xp-badge--download {
  background: rgba(22, 163, 74, 0.11);
  color: #15803d;
}

html[data-theme="light"] [data-explore] .xp-badge--feat,
html[data-theme="light"] [data-explore] .xp-badge--enterprise {
  background: rgba(217, 119, 6, 0.11);
  color: #b45309;
}

html[data-theme="light"] [data-explore] .xp-btn-ora {
  color: #06121f;
  background: linear-gradient(135deg, #8ea2ff 0%, #22c7e9 100%);
  box-shadow: 0 16px 34px -22px rgba(8, 145, 178, 0.55);
}

html[data-theme="light"] [data-explore] .xp-btn-ghost,
html[data-theme="light"] [data-explore] .xp-src-btn {
  color: #384152;
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(30, 41, 59, 0.12);
}

html[data-theme="light"] [data-explore] .xp-btn-ghost:hover,
html[data-theme="light"] [data-explore] .xp-src-btn:hover {
  color: var(--xp-ink);
  border-color: rgba(124, 58, 237, 0.26);
  background: #ffffff;
}

html[data-theme="light"] [data-explore] .xp-detail {
  background:
    radial-gradient(700px 360px at 10% 0%, rgba(124, 58, 237, 0.10), transparent 70%),
    #fbfbfe;
  border-left-color: rgba(30, 41, 59, 0.10);
  box-shadow: -28px 0 74px rgba(15, 23, 42, 0.15);
}

html[data-theme="light"] [data-explore] .xp-detail-backdrop {
  background: rgba(241, 245, 249, 0.64);
}

html[data-theme="light"] [data-explore] .xp-detail-section,
html[data-theme="light"] [data-explore] .xp-catalog-sidebar .xp-filter-group + .xp-filter-group {
  border-color: rgba(30, 41, 59, 0.08);
}

html[data-theme="light"] [data-explore] .xp-spec-grid div,
html[data-theme="light"] [data-explore] .xp-ora-tip,
html[data-theme="light"] [data-explore] .xp-banner {
  background: rgba(248, 250, 252, 0.78);
  border-color: rgba(30, 41, 59, 0.08);
}

html[data-theme="light"] [data-explore] .xp-detail-sticky-foot {
  background: rgba(255, 255, 255, 0.92);
  border-top-color: rgba(30, 41, 59, 0.10);
  box-shadow: 0 -18px 44px -28px rgba(15, 23, 42, 0.28);
}

html[data-theme="light"] .xp-chart-tooltip {
  color: #111827;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(30, 41, 59, 0.12);
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .xp-chart-tooltip span {
  color: #64748b;
}

/* Blueprint live learning chat */
.xp-bp-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #34d399;
}
.xp-bp-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: xp-bp-pulse 2s ease-in-out infinite;
}
@keyframes xp-bp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
.xp-bp-typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px !important;
}
.xp-bp-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-1);
  animation: xp-bp-dot 1.2s ease-in-out infinite;
}
.xp-bp-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.xp-bp-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes xp-bp-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.xp-bp-msg a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.xp-bp-msg strong { color: var(--fg); }
.xp-bp-card .xp-btn-ora {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
@media (max-width: 960px) {
  .xp-bp-layout { grid-template-columns: 1fr; }
  .xp-bp-aside {
    position: sticky;
    top: calc(var(--nav-h) + 4px);
    z-index: 12;
    order: -1;
  }
  .xp-bp-chat { height: min(480px, 55vh); }
}
