/* Marketplace page styles */

:root {
  --marketplace-header-height: 74px;
  --marketplace-sidebar-width: 340px;
  --marketplace-surface: rgba(255, 255, 255, 0.92);
  --marketplace-border: rgba(148, 163, 184, 0.38);
  --marketplace-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

.marketplace-header {
  height: var(--marketplace-header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--marketplace-border);
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.marketplace-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.marketplace-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.marketplace-logo-link #site-mills-logo {
  width: 136px;
  height: auto;
}

.marketplace-topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.marketplace-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.marketplace-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
}

.marketplace-btn-icon svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.marketplace-searchbar {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--marketplace-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  padding: 0 6px 0 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.marketplace-searchbar:focus-within {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.marketplace-searchbar input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--primary-text-color, #0f172a);
  font-size: 14px;
  padding: 10px 2px;
}

.marketplace-searchbar input[type="search"]:focus {
  outline: none;
}

.marketplace-search-button,
.marketplace-settings-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-text-color, #0f172a);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.marketplace-search-button:hover,
.marketplace-settings-button:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.marketplace-search-button svg,
.marketplace-settings-button svg {
  width: 20px;
  height: 20px;
}

.marketplace-create-project-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, var(--accent-color-2-start, #1d4ed8), var(--accent-color-2-end, #2563eb));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.34);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  z-index: 44;
}

.marketplace-create-project-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.4);
  filter: brightness(1.04);
}

.marketplace-create-project-fab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28), 0 14px 30px rgba(37, 99, 235, 0.34);
}

.marketplace-create-project-fab svg {
  width: 28px;
  height: 28px;
}

body.marketplace-create-open .marketplace-create-project-fab {
  background: linear-gradient(135deg, var(--accent-color-2-hover-start, #1e40af), var(--accent-color-2-hover-end, #1d4ed8));
}

.marketplace-header-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-self: end;
  border: 1px solid var(--marketplace-border);
  border-radius: 999px;
  padding: 9px 14px;
  text-decoration: none;
  color: var(--primary-text-color, #0f172a);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.marketplace-header-action:hover {
  border-color: rgba(37, 99, 235, 0.65);
  background: rgba(37, 99, 235, 0.08);
}

.marketplace-main {
  min-height: calc(100vh - var(--marketplace-header-height));
  width: 100%;
  position: relative;
}

.marketplace-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: var(--marketplace-header-height) 0 0 0;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(2, 6, 23, 0.48);
  z-index: 38;
}

.marketplace-sidebar {
  position: fixed;
  top: calc(var(--marketplace-header-height) + 12px);
  right: 12px;
  bottom: 12px;
  width: var(--marketplace-sidebar-width);
  max-width: calc(100vw - 24px);
  border: 1px solid var(--marketplace-border);
  border-radius: 16px;
  background: var(--marketplace-surface);
  backdrop-filter: blur(12px);
  padding: 22px 20px 30px;
  overflow-y: auto;
  transform: translateX(calc(100% + 16px));
  transition: transform 0.25s ease;
  z-index: 39;
}

body.marketplace-filter-panel-open .marketplace-sidebar {
  transform: translateX(0);
}

body.marketplace-filter-panel-open .marketplace-sidebar-backdrop {
  display: block;
}

.marketplace-sidebar h3 {
  margin: 0;
  font-size: 22px;
  color: var(--primary-text-color, #0f172a);
}

.sidebar-subtitle {
  margin: 8px 0 20px;
  color: var(--secondary-text-color, #334155);
  font-size: 13px;
  line-height: 1.45;
}

.filter-group {
  margin-bottom: 18px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary-text-color, #334155);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.filter-group h4 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary-text-color, #334155);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.marketplace-sidebar select {
  width: 100%;
  border: 1px solid var(--marketplace-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-text-color, #0f172a);
  padding: 10px 11px;
  font-size: 14px;
  box-sizing: border-box;
}

.marketplace-sidebar select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.sidebar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  background: linear-gradient(145deg, #1d4ed8, #2563eb);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.3);
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.category-list li label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-text-color, #0f172a);
  cursor: pointer;
}

.marketplace-content {
  width: min(1320px, 100%);
  margin: 0 auto;
  min-width: 0;
  padding: 20px 24px 30px;
}

.marketplace-hero {
  border: 1px solid rgba(30, 64, 175, 0.16);
  border-radius: 20px;
  padding: 14px 18px;
  background:
    radial-gradient(circle at 90% 0%, rgba(37, 99, 235, 0.14), transparent 52%),
    radial-gradient(circle at 0% 100%, rgba(2, 132, 199, 0.12), transparent 46%),
    linear-gradient(145deg, rgba(250, 252, 255, 0.96), rgba(241, 246, 255, 0.95));
  box-shadow: var(--marketplace-shadow);
}

.marketplace-hero-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.marketplace-info-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  margin-top: 1px;
  flex-shrink: 0;
}

.marketplace-hero-note p {
  margin: 0;
  max-width: 950px;
  color: var(--secondary-text-color, #334155);
  font-size: 14px;
  line-height: 1.5;
}

.marketplace-create-overlay {
  position: fixed;
  inset: 0;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(2, 6, 23, 0.52);
  z-index: 42;
}

.marketplace-create-overlay[hidden] {
  display: none;
}

.marketplace-detail-overlay {
  position: fixed;
  inset: 0;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(2, 6, 23, 0.56);
  z-index: 45;
}

.marketplace-detail-overlay[hidden] {
  display: none;
}

.marketplace-detail-panel {
  position: fixed;
  inset: calc(var(--marketplace-header-height) + 18px) 24px 24px;
  z-index: 46;
  pointer-events: none;
}

.marketplace-detail-panel[hidden] {
  display: none;
}

.marketplace-detail-shell {
  pointer-events: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 58px rgba(15, 23, 42, 0.34);
  overflow: hidden;
}

.marketplace-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  background:
    radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.16), transparent 48%),
    linear-gradient(145deg, rgba(250, 252, 255, 0.98), rgba(241, 245, 255, 0.95));
}

.marketplace-detail-header-copy {
  min-width: 0;
}

.marketplace-detail-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #1d4ed8;
}

.marketplace-detail-header h2 {
  margin: 6px 0 0;
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.9rem);
  color: var(--primary-text-color, #0f172a);
  line-height: 1.2;
}

.marketplace-detail-owner-line {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--secondary-text-color, #475569);
  font-size: 13px;
}

.marketplace-detail-owner-line a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.marketplace-detail-owner-line a:hover {
  text-decoration: underline;
}

.marketplace-detail-close {
  border: 1px solid var(--marketplace-border);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary-text-color, #0f172a);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.marketplace-detail-close:hover {
  border-color: rgba(37, 99, 235, 0.65);
  background: rgba(37, 99, 235, 0.1);
}

.marketplace-detail-loading,
.marketplace-detail-error {
  margin: auto;
  padding: 18px;
  text-align: center;
  color: var(--secondary-text-color, #475569);
}

.marketplace-detail-error {
  max-width: 520px;
  font-weight: 600;
}

.marketplace-detail-content {
  padding: 18px 20px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.marketplace-detail-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
}

.marketplace-detail-hero-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.72);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.marketplace-detail-banner {
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(37, 99, 235, 0.12), rgba(2, 132, 199, 0.16));
  display: grid;
  place-items: center;
}

.marketplace-detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.marketplace-detail-description {
  margin: 0;
  color: var(--secondary-text-color, #334155);
  font-size: 14px;
  line-height: 1.65;
}

.marketplace-detail-sidepanel {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.88);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.marketplace-detail-meta-item {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.7);
}

.marketplace-detail-meta-label {
  color: var(--secondary-text-color, #475569);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.marketplace-detail-meta-value {
  color: var(--primary-text-color, #0f172a);
  font-size: 15px;
  font-weight: 700;
}

.marketplace-detail-gallery-block,
.marketplace-detail-comments-block {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 14px;
  background: rgba(248, 250, 252, 0.84);
}

.marketplace-detail-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.marketplace-detail-block-header h3 {
  margin: 0;
  color: var(--primary-text-color, #0f172a);
  font-size: 16px;
}

.marketplace-detail-block-header span {
  color: var(--secondary-text-color, #475569);
  font-size: 13px;
  font-weight: 600;
}

.marketplace-detail-gallery {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.marketplace-detail-gallery-item {
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85);
}

.marketplace-detail-gallery-item img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  display: block;
}

.marketplace-detail-gallery-empty {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 10px;
  min-height: 100px;
  display: grid;
  place-items: center;
  color: var(--secondary-text-color, #475569);
}

.marketplace-detail-gallery-empty p {
  margin: 0;
  font-size: 13px;
}

.marketplace-detail-comments-subtitle {
  margin: 6px 0 0;
  color: var(--secondary-text-color, #475569);
  font-size: 12px;
}

.marketplace-comment-composer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.marketplace-comment-composer label {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary-text-color, #475569);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#marketplace-detail-comment-input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  color: var(--primary-text-color, #0f172a);
  background: rgba(255, 255, 255, 0.96);
  resize: vertical;
  box-sizing: border-box;
}

#marketplace-detail-comment-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.marketplace-comment-submit {
  align-self: flex-end;
  border: none;
  border-radius: 10px;
  background: linear-gradient(145deg, #1d4ed8, #2563eb);
  color: #fff;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.marketplace-comment-submit:hover {
  filter: brightness(1.04);
}

.marketplace-comment-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.marketplace-comment-login {
  margin-top: 12px;
}

.marketplace-comment-login a {
  text-decoration: none;
  font-size: 13px;
  color: #1d4ed8;
  font-weight: 700;
}

.marketplace-detail-comments {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.marketplace-comment-card {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.marketplace-comment-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.marketplace-comment-author-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.marketplace-comment-author {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
}

.marketplace-comment-author:hover {
  text-decoration: underline;
}

.marketplace-comment-time {
  color: var(--secondary-text-color, #64748b);
  font-size: 12px;
}

.marketplace-comment-text {
  margin: 0;
  color: var(--primary-text-color, #0f172a);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.marketplace-comment-helpful-btn,
.marketplace-comment-helpful-link {
  border: 1px solid rgba(148, 163, 184, 0.44);
  border-radius: 999px;
  min-height: 30px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--secondary-text-color, #334155);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.marketplace-comment-helpful-btn svg,
.marketplace-comment-helpful-link svg {
  width: 13px;
  height: 13px;
}

.marketplace-comment-helpful-btn {
  cursor: pointer;
}

.marketplace-comment-helpful-btn.active {
  border-color: rgba(37, 99, 235, 0.82);
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
}

.marketplace-comment-helpful-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.marketplace-comment-helpful-link {
  color: #1d4ed8;
}

.marketplace-comment-helpful-count {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
  padding: 1px 6px;
}

.marketplace-comment-empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: var(--secondary-text-color, #475569);
}

.marketplace-comment-empty-state h4,
.marketplace-comment-empty-state p {
  margin: 0;
}

.marketplace-comment-empty-state h4 {
  margin-bottom: 4px;
  color: var(--primary-text-color, #0f172a);
}

body.marketplace-detail-open {
  overflow: hidden;
}

body.marketplace-detail-open .marketplace-create-project-fab {
  opacity: 0;
  pointer-events: none;
}

.marketplace-create-compose {
  position: fixed;
  left: 20px;
  bottom: 94px;
  width: min(520px, calc(100vw - 40px));
  margin: 0;
  background: var(--textarea-bg-color, rgba(255, 255, 255, 0.98));
  border-radius: 16px;
  padding: 1.2rem 1.25rem;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
  border: 1px solid var(--marketplace-border);
  z-index: 44;
}

.marketplace-create-compose[hidden] {
  display: none;
}

.marketplace-compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.marketplace-create-compose h2 {
  margin: 0;
  color: var(--primary-text-color, #0f172a);
  font-size: 1.4rem;
  font-weight: 600;
}

.marketplace-create-close {
  position: static;
  border: 1px solid var(--marketplace-border);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary-text-color, #0f172a);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.marketplace-create-close:hover {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.08);
}

.marketplace-create-compose .project-create-intro {
  margin: 0 0 1rem;
  color: var(--secondary-text-color, #334155);
  font-size: 1rem;
}

.marketplace-create-compose .dashboard-search-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.marketplace-create-compose .project-fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.marketplace-create-compose .field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.marketplace-create-compose .field-group label {
  font-weight: 600;
  color: var(--primary-text-color, #0f172a);
  font-size: 0.875rem;
}

#marketplace-project-name,
#marketplace-project-description {
  width: 100%;
  border: 2px solid var(--textarea-border-color, var(--marketplace-border));
  background-color: var(--textarea-bg-color, rgba(255, 255, 255, 0.95));
  color: var(--textarea-text-color, var(--primary-text-color, #0f172a));
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

#marketplace-project-name {
  padding: 0.75rem;
  border-radius: 8px;
}

#marketplace-project-name::placeholder,
#marketplace-project-description::placeholder {
  color: var(--textarea-placeholder-color, #64748b);
  opacity: 0.8;
}

#marketplace-project-description {
  min-height: 120px;
  padding: 1rem;
  border-radius: 12px;
  resize: vertical;
}

#marketplace-project-name:focus,
#marketplace-project-description:focus {
  outline: none;
  border-color: var(--textarea-focus-border-color, rgba(37, 99, 235, 0.75));
  background-color: var(--textarea-focus-bg-color, rgba(255, 255, 255, 1));
  box-shadow: 0 0 0 3px var(--textarea-focus-shadow-color, rgba(37, 99, 235, 0.18));
}

.marketplace-create-compose .field-hint {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--secondary-text-color, #475569);
}

.marketplace-create-compose .url-preview {
  font-family: 'Courier New', monospace;
  background: rgba(66, 133, 244, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(66, 133, 244, 0.2);
}

.marketplace-create-compose .field-error {
  color: #dc3545;
  font-size: 0.75rem;
  font-weight: 500;
  min-height: 1rem;
}

.marketplace-create-compose .prompt-attachments-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.marketplace-create-compose .prompt-attachments-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px dashed var(--textarea-border-color, var(--marketplace-border));
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  background: var(--textarea-bg-color, rgba(255, 255, 255, 0.95));
  color: var(--primary-text-color, #0f172a);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.marketplace-create-compose .prompt-attachments-button svg {
  width: 15px;
  height: 15px;
}

.marketplace-create-compose .prompt-attachments-button:hover {
  border-color: var(--textarea-focus-border-color, rgba(37, 99, 235, 0.75));
  background: var(--textarea-focus-bg-color, rgba(255, 255, 255, 1));
}

.marketplace-create-compose .prompt-attachments-summary {
  font-size: 0.78rem;
  color: var(--secondary-text-color, #475569);
}

.marketplace-create-compose .prompt-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.marketplace-create-compose .prompt-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(66, 133, 244, 0.28);
  background: rgba(66, 133, 244, 0.1);
  color: var(--primary-text-color, #0f172a);
  padding: 0.22rem 0.5rem;
  min-height: 28px;
}

.marketplace-create-compose .prompt-attachment-chip-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 600;
}

.marketplace-create-compose .prompt-attachment-chip-size {
  font-size: 0.7rem;
  color: var(--secondary-text-color, #475569);
}

.marketplace-create-compose .prompt-attachment-remove {
  border: none;
  background: transparent;
  color: var(--primary-text-color, #0f172a);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
  cursor: pointer;
}

.marketplace-create-compose .prompt-attachment-remove:hover {
  background: rgba(15, 23, 42, 0.12);
}

.marketplace-create-compose .model-hint {
  font-style: italic;
  opacity: 0.82;
}

#marketplace-create-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  align-self: flex-end;
  min-width: 170px;
  background: linear-gradient(135deg, var(--accent-color-2-start, #1d4ed8), var(--accent-color-2-end, #2563eb));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--accent-color-2-shadow, rgba(37, 99, 235, 0.24));
  position: relative;
  overflow: hidden;
}

#marketplace-create-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

#marketplace-create-submit:hover {
  background: linear-gradient(135deg, var(--accent-color-2-hover-start, #1e40af), var(--accent-color-2-hover-end, #1d4ed8));
  box-shadow: 0 6px 16px var(--accent-color-2-hover-shadow, rgba(37, 99, 235, 0.32));
  transform: translateY(-2px);
}

#marketplace-create-submit:hover::before {
  left: 100%;
}

#marketplace-create-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.marketplace-results-section {
  margin-top: 18px;
}

.marketplace-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.marketplace-results-summary {
  color: var(--secondary-text-color, #334155);
  font-size: 14px;
  font-weight: 600;
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.marketplace-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--marketplace-border);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  min-height: 100%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.marketplace-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: 2px;
}

.marketplace-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.marketplace-card-preview {
  height: 136px;
  background: linear-gradient(140deg, rgba(37, 99, 235, 0.08), rgba(2, 132, 199, 0.11));
  display: flex;
  align-items: center;
  justify-content: center;
}

.marketplace-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.marketplace-card-initials {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1d4ed8, #0ea5e9);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.marketplace-card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.marketplace-card-content h3 {
  margin: 0;
  font-size: 16px;
  color: var(--primary-text-color, #0f172a);
  line-height: 1.3;
}

.marketplace-card-description {
  margin: 0;
  color: var(--secondary-text-color, #334155);
  font-size: 13px;
  line-height: 1.5;
  min-height: 3.6em;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mock-gallery {
  display: flex;
  gap: 8px;
  margin: 8px 0 2px;
}

.mock-gallery-img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #e5e7eb;
}

.marketplace-rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1;
}

.marketplace-rating-stars {
  letter-spacing: 1px;
  color: #f59e0b;
}

.marketplace-rating-value {
  color: var(--primary-text-color, #0f172a);
  font-weight: 700;
}

.marketplace-rating-count {
  color: var(--secondary-text-color, #475569);
}

.marketplace-rating-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: -2px;
}

.marketplace-rate-btn {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.marketplace-rate-btn.active,
.marketplace-rate-btn:hover {
  color: #f59e0b;
}

.marketplace-rate-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.marketplace-rating-login {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 12px;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.marketplace-rating-login:hover {
  text-decoration: underline;
}

.mock-reviews {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #f59e0b;
}

.mock-reviews span.count {
  color: var(--secondary-text-color, #475569);
  margin-left: 4px;
}

.marketplace-card-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 12px;
  color: var(--secondary-text-color, #475569);
}

.marketplace-card-meta a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.marketplace-card-meta a:hover {
  text-decoration: underline;
}

.marketplace-card-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.6;
}

.marketplace-card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.marketplace-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  border: 1px solid var(--marketplace-border);
  border-radius: 10px;
  min-height: 34px;
  padding: 0 11px;
  color: var(--primary-text-color, #0f172a);
  font-size: 13px;
  font-weight: 700;
}

.marketplace-card-btn:hover {
  border-color: rgba(37, 99, 235, 0.7);
  color: #1d4ed8;
}

.marketplace-detail-open-btn {
  background: rgba(37, 99, 235, 0.08);
}

.marketplace-empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--marketplace-border);
  border-radius: 16px;
  padding: 26px;
  text-align: center;
  color: var(--secondary-text-color, #334155);
  display: grid;
  place-items: center;
  gap: 10px;
}

.marketplace-empty-state h3 {
  margin: 0;
  color: var(--primary-text-color, #0f172a);
}

.marketplace-empty-state p {
  margin: 0;
}

.marketplace-pagination-controls {
  margin-top: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.marketplace-page-btn,
.marketplace-page-nav {
  border: 1px solid var(--marketplace-border);
  border-radius: 8px;
  min-width: 36px;
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--secondary-text-color, #334155);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.marketplace-page-btn.active {
  border-color: rgba(37, 99, 235, 0.9);
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}

.marketplace-page-nav:disabled,
.marketplace-page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(148, 163, 184, 0.3);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

body.dark-theme {
  --marketplace-surface: rgba(15, 23, 42, 0.82);
  --marketplace-border: rgba(148, 163, 184, 0.3);
  --marketplace-shadow: 0 24px 48px rgba(2, 6, 23, 0.45);
}

body.dark-theme .marketplace-header {
  background: rgba(15, 23, 42, 0.94);
}

body.dark-theme .marketplace-searchbar,
body.dark-theme .marketplace-search-button,
body.dark-theme .marketplace-settings-button {
  background: rgba(30, 41, 59, 0.75);
}

body.dark-theme .marketplace-searchbar input[type="search"] {
  color: rgba(226, 232, 240, 0.94);
}

body.dark-theme .marketplace-header-action {
  color: rgba(226, 232, 240, 0.92);
  background: rgba(30, 41, 59, 0.45);
}

body.dark-theme .marketplace-header-action:hover {
  background: rgba(30, 64, 175, 0.24);
}

body.dark-theme .marketplace-sidebar select {
  background: rgba(15, 23, 42, 0.86);
  color: rgba(226, 232, 240, 0.94);
}

body.dark-theme .marketplace-info-icon {
  border-color: rgba(125, 211, 252, 0.45);
  color: #7dd3fc;
}

body.dark-theme .marketplace-create-project-fab {
  box-shadow: 0 14px 32px rgba(30, 64, 175, 0.48);
}

body.dark-theme .marketplace-create-overlay {
  background: rgba(2, 6, 23, 0.66);
}

body.dark-theme .marketplace-create-close {
  background: rgba(30, 41, 59, 0.85);
  color: rgba(226, 232, 240, 0.92);
}

body.dark-theme .marketplace-create-compose {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.3);
}

body.dark-theme #marketplace-project-name,
body.dark-theme #marketplace-project-description {
  background: rgba(30, 41, 59, 0.85);
  color: rgba(226, 232, 240, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

body.dark-theme #marketplace-project-name::placeholder,
body.dark-theme #marketplace-project-description::placeholder {
  color: rgba(203, 213, 225, 0.72);
}

body.dark-theme .marketplace-create-compose .field-error {
  color: #fda4af;
}

body.dark-theme .marketplace-create-compose .prompt-attachments-button {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.85);
  color: rgba(226, 232, 240, 0.92);
}

body.dark-theme .marketplace-create-compose .prompt-attachments-summary,
body.dark-theme .marketplace-create-compose .prompt-attachment-chip-size {
  color: rgba(203, 213, 225, 0.82);
}

body.dark-theme .marketplace-create-compose .prompt-attachment-chip {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(30, 64, 175, 0.32);
  color: rgba(226, 232, 240, 0.92);
}

body.dark-theme .marketplace-create-compose .prompt-attachment-remove {
  color: rgba(226, 232, 240, 0.92);
}

body.dark-theme .marketplace-create-compose .prompt-attachment-remove:hover {
  background: rgba(226, 232, 240, 0.18);
}

body.dark-theme .category-list li label,
body.dark-theme .sidebar-subtitle,
body.dark-theme .marketplace-results-summary,
body.dark-theme .marketplace-card-description,
body.dark-theme .marketplace-card-meta,
body.dark-theme .marketplace-empty-state {
  color: rgba(203, 213, 225, 0.92);
}

body.dark-theme .marketplace-rating-value,
body.dark-theme .marketplace-rating-count {
  color: rgba(226, 232, 240, 0.9);
}

body.dark-theme .marketplace-rate-btn {
  color: rgba(148, 163, 184, 0.8);
}

body.dark-theme .marketplace-rate-btn.active,
body.dark-theme .marketplace-rate-btn:hover {
  color: #fbbf24;
}

body.dark-theme .marketplace-rating-login {
  color: #bfdbfe;
}

body.dark-theme .marketplace-card {
  background: rgba(15, 23, 42, 0.78);
}

body.dark-theme .marketplace-card-btn {
  background: rgba(30, 41, 59, 0.45);
  color: rgba(226, 232, 240, 0.94);
}

body.dark-theme .marketplace-card-btn:hover {
  color: #bfdbfe;
}

body.dark-theme .marketplace-page-btn,
body.dark-theme .marketplace-page-nav {
  color: rgba(226, 232, 240, 0.9);
  background: rgba(15, 23, 42, 0.72);
}

body.dark-theme .marketplace-page-btn.active {
  color: #bfdbfe;
  background: rgba(30, 64, 175, 0.3);
}

body.dark-theme .marketplace-detail-overlay {
  background: rgba(2, 6, 23, 0.7);
}

body.dark-theme .marketplace-detail-shell {
  background: rgba(15, 23, 42, 0.97);
  border-color: rgba(148, 163, 184, 0.35);
}

body.dark-theme .marketplace-detail-header {
  background:
    radial-gradient(circle at 90% 10%, rgba(30, 64, 175, 0.3), transparent 48%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.93));
  border-color: rgba(148, 163, 184, 0.3);
}

body.dark-theme .marketplace-detail-kicker,
body.dark-theme .marketplace-comment-login a,
body.dark-theme .marketplace-comment-helpful-link {
  color: #93c5fd;
}

body.dark-theme .marketplace-detail-owner-line,
body.dark-theme .marketplace-detail-loading,
body.dark-theme .marketplace-detail-error,
body.dark-theme .marketplace-detail-comments-subtitle,
body.dark-theme .marketplace-comment-time,
body.dark-theme .marketplace-detail-block-header span,
body.dark-theme .marketplace-detail-gallery-empty,
body.dark-theme .marketplace-comment-empty-state {
  color: rgba(203, 213, 225, 0.86);
}

body.dark-theme .marketplace-detail-owner-line a,
body.dark-theme .marketplace-comment-author {
  color: #bfdbfe;
}

body.dark-theme .marketplace-detail-close {
  background: rgba(30, 41, 59, 0.86);
  color: rgba(226, 232, 240, 0.92);
}

body.dark-theme .marketplace-detail-hero-card,
body.dark-theme .marketplace-detail-sidepanel,
body.dark-theme .marketplace-detail-gallery-block,
body.dark-theme .marketplace-detail-comments-block,
body.dark-theme .marketplace-detail-meta-item,
body.dark-theme .marketplace-detail-gallery-item,
body.dark-theme .marketplace-comment-card,
body.dark-theme .marketplace-comment-empty-state {
  background: rgba(30, 41, 59, 0.66);
  border-color: rgba(148, 163, 184, 0.32);
}

body.dark-theme .marketplace-detail-meta-label {
  color: rgba(203, 213, 225, 0.76);
}

body.dark-theme .marketplace-detail-meta-value,
body.dark-theme .marketplace-detail-description,
body.dark-theme .marketplace-detail-block-header h3,
body.dark-theme .marketplace-comment-text,
body.dark-theme .marketplace-comment-empty-state h4 {
  color: rgba(226, 232, 240, 0.95);
}

body.dark-theme #marketplace-detail-comment-input {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.38);
  color: rgba(226, 232, 240, 0.94);
}

body.dark-theme .marketplace-comment-helpful-btn,
body.dark-theme .marketplace-comment-helpful-link {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.44);
  color: rgba(226, 232, 240, 0.9);
}

body.dark-theme .marketplace-comment-helpful-btn.active {
  border-color: rgba(96, 165, 250, 0.9);
  color: #bfdbfe;
  background: rgba(30, 64, 175, 0.34);
}

body.dark-theme .marketplace-comment-helpful-count {
  background: rgba(148, 163, 184, 0.26);
}

@media (max-width: 980px) {
  :root {
    --marketplace-header-height: 68px;
  }

  .marketplace-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .marketplace-content {
    padding: 16px 14px 24px;
  }

  .marketplace-sidebar {
    top: calc(var(--marketplace-header-height) + 8px);
    right: 8px;
    bottom: 8px;
    width: min(360px, calc(100vw - 16px));
  }

  .marketplace-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-detail-panel {
    inset: var(--marketplace-header-height) 0 0 0;
  }

  .marketplace-detail-shell {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .marketplace-detail-content {
    padding: 14px;
  }

  .marketplace-detail-top-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-detail-banner {
    height: 220px;
  }

  .marketplace-create-project-fab {
    left: 16px;
    bottom: 16px;
  }

  .marketplace-create-compose {
    left: 12px;
    right: 12px;
    bottom: 84px;
    width: auto;
    max-height: calc(100vh - var(--marketplace-header-height) - 98px);
    overflow-y: auto;
    border-radius: 14px;
  }
}

@media (max-width: 640px) {
  .marketplace-header {
    padding: 0 12px;
  }

  .marketplace-topbar-controls {
    gap: 8px;
  }

  .marketplace-header-action {
    padding: 7px 12px;
    font-size: 13px;
  }

  .marketplace-searchbar {
    border-radius: 12px;
    padding-left: 10px;
  }

  .marketplace-searchbar input[type="search"] {
    font-size: 13px;
  }

  .marketplace-logo-link #site-mills-logo {
    width: 120px;
  }

  .marketplace-hero {
    padding: 12px 14px;
  }

  .marketplace-hero-note p {
    font-size: 13px;
  }

  .marketplace-detail-header {
    padding: 14px 12px 12px;
  }

  .marketplace-detail-content {
    padding: 12px;
    gap: 12px;
  }

  .marketplace-detail-banner {
    height: 180px;
  }

  .marketplace-detail-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketplace-comment-submit {
    width: 100%;
    align-self: stretch;
  }

  .marketplace-card-actions .marketplace-card-btn {
    flex: 1;
  }

  .marketplace-create-project-fab {
    left: 12px;
    bottom: 12px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .marketplace-create-compose {
    left: 8px;
    right: 8px;
    bottom: 72px;
    padding: 1rem;
  }

  .marketplace-create-compose h2 {
    font-size: 1.2rem;
  }

  #marketplace-create-submit {
    width: 100%;
    align-self: stretch;
    padding: 11px 16px;
    font-size: 15px;
  }
}
