.discovery-page main {
  min-width: 0;
}

.discovery-page .ui-page-header {
  margin-bottom: 16px;
}

.discovery-page .main-tabs {
  margin-bottom: 12px;
}

.discovery-page .filter-section {
  margin-bottom: 14px;
}

.discovery-page .template-prompt-bridge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
}

.discovery-page .template-prompt-bridge__label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.discovery-page .template-prompt-bridge__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.discovery-page .template-prompt-bridge__links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.discovery-page .template-prompt-bridge__links a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.discovery-page .template-prompt-bridge__links .template-prompt-bridge__more {
  border-color: transparent;
  background: transparent;
  color: var(--brand);
  font-weight: 600;
}

.discovery-page .masonry-grid {
  min-height: 240px;
}

.activity-page .ui-page-header {
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .discovery-page .ui-page-header {
    margin-bottom: 12px;
  }
}


/* ===== 2026-11-28 Multi-Modal Templates Toolbar, Gallery Grid, Engine Badges & Audio/Long Indicators ===== */
.discovery-page .ui-page-actions {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}
.discovery-page .ui-page-actions > a {
  white-space: nowrap;
}
.discovery-page .masonry-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
@media (min-width: 768px) {
  .discovery-page .masonry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}
@media (min-width: 1120px) {
  .discovery-page .masonry-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}
@media (min-width: 1560px) {
  .discovery-page .masonry-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }
}
.discovery-page .templates-top-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.discovery-page .templates-top-controls .main-tabs {
  margin-bottom: 0;
}
.discovery-page .tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  margin-left: 5px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.14);
  color: inherit;
  font-size: 11px;
  font-weight: 600;
}
.discovery-page .tab-count-badge:empty {
  display: none;
}
.discovery-page .main-tab.is-active .tab-count-badge {
  background: rgba(255, 255, 255, 0.22);
}
.discovery-page .templates-search-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 340px;
  max-width: 500px;
}
.discovery-page .templates-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, var(--bg-elevated, #ffffff));
  color: var(--text-secondary);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.discovery-page .templates-search-box:focus-within {
  border-color: var(--brand, #146cff);
  box-shadow: 0 0 0 3px rgba(20, 108, 255, 0.12);
}
.discovery-page .templates-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text, inherit);
  font-size: 13px;
}
.discovery-page .templates-sort-select {
  flex: 0 0 auto;
  height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, var(--bg-elevated, #ffffff));
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
html.dark-mode .discovery-page .templates-search-box,
html.dark-mode .discovery-page .templates-sort-select {
  background: #131e31;
  border-color: rgba(71, 105, 148, 0.45);
  color: #dbe8f8;
  color-scheme: dark;
}
.discovery-page .filter-pill__count {
  margin-left: 3px;
  opacity: 0.68;
  font-size: 11px;
}
.creation-card .card-official-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.creation-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.creation-card .card-content .card-tag {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.35;
  padding: 2px 8px;
  border-radius: 999px;
}
.creation-card .card-content .card-tag:not(.card-tag--engine) {
  background: #f1f5f9 !important;
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #475569 !important;
  font-weight: 500;
}
html.dark-mode .creation-card .card-content .card-tag:not(.card-tag--engine) {
  background: rgba(148, 163, 184, 0.14) !important;
  border-color: rgba(148, 163, 184, 0.24);
  color: #cbd5e1 !important;
}
.creation-card .card-tag--engine {
  background: rgba(20, 108, 255, 0.10) !important;
  border: 1px solid rgba(20, 108, 255, 0.20);
  color: #146cff !important;
  font-weight: 600;
}
html.dark-mode .creation-card .card-tag--engine {
  background: rgba(59, 130, 246, 0.20) !important;
  border-color: rgba(96, 165, 250, 0.30);
  color: #93c5fd !important;
}
.creation-card .card-media-badge--audio {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.92), rgba(14, 165, 233, 0.92));
  color: #ffffff;
}
.creation-card .card-audio-vinyl-indicator {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.creation-card .card-img-wrapper--tall img {
  max-height: 380px;
  object-fit: cover;
  object-position: top center;
}
.discovery-page .templates-compliance-note {
  margin: 12px 0 6px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}
@media (max-width: 768px) {
  .discovery-page .ui-page-actions {
    flex-wrap: wrap;
  }
  .discovery-page .templates-search-sort {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .discovery-page .templates-search-box {
    height: 36px;
  }
  .discovery-page .templates-sort-select {
    height: 36px;
    padding: 5px 10px;
    font-size: 12px;
  }
  .creation-card .card-official-badge {
    display: none;
  }
}
