/* Marketplace colors and typography match the Nature-Spy community. */
:root {
  --ns-primary: #245a43;
  --ns-primary-dark: #194330;
  --ns-primary-soft: #eaf2ec;
  --ns-on-primary: #ffffff;
  --ns-page: #f7f8f4;
  --ns-surface: #ffffff;
  --ns-surface-soft: #f1f4ee;
  --ns-text: #24352c;
  --ns-muted: #637168;
  --ns-border: #dfe5dc;
  --ns-shadow: 0 4px 20px rgb(29 52 36 / 4%);
  --primary-50: 244 248 244;
  --primary-100: 234 242 236;
  --primary-200: 204 224 208;
  --primary-300: 155 198 170;
  --primary-400: 111 164 132;
  --primary-500: 61 120 87;
  --primary-600: 36 90 67;
  --primary-700: 25 67 48;
  --primary-800: 23 55 41;
  --primary-900: 20 45 35;
  --primary-950: 14 29 23;
}

html.dark {
  --ns-primary: #9bc6aa;
  --ns-primary-dark: #b8d9c3;
  --ns-primary-soft: #263e30;
  --ns-on-primary: #1c2821;
  --ns-page: #141d18;
  --ns-surface: #1c2821;
  --ns-surface-soft: #243228;
  --ns-text: #e8eee7;
  --ns-muted: #a9b8ad;
  --ns-border: #36463b;
  --ns-shadow: none;
  --primary-500: 155 198 170;
  --primary-600: 155 198 170;
  --primary-700: 184 217 195;
}

body.ns-marketplace {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif !important;
  background: var(--ns-page) !important;
  color: var(--ns-text) !important;
  line-height: 1.6;
}
body.ns-marketplace :is(h1, h2, h3, h4, h5, h6) { font-weight: 600; }
body.ns-marketplace :is(.text-gray-950, .text-gray-900, .text-gray-800) { color: var(--ns-text); }
body.ns-marketplace :is(.text-gray-600, .text-gray-500, .text-muted) { color: var(--ns-muted); }
body.ns-marketplace :is(.bg-white, .fi-modal-window, .fi-dropdown-panel, .fi-section, .fi-input-wrp) { background-color: var(--ns-surface); }
body.ns-marketplace :is(.bg-gray-50, .bg-gray-100) { background-color: var(--ns-surface-soft); }
body.ns-marketplace .border-gray-200 { border-color: var(--ns-border); }
body.ns-marketplace :is(.text-primary-600, .text-primary-500) { color: var(--ns-primary) !important; }
html.dark body.ns-marketplace :is(.dark\:text-primary-600, .dark\:text-primary-500) { color: var(--ns-primary) !important; }
body.ns-marketplace .bg-primary-400 { background: var(--ns-primary-soft) !important; color: var(--ns-text); }
body.ns-marketplace :is(input, textarea, select) { color: var(--ns-text); accent-color: var(--ns-primary); }
body.ns-marketplace :is(input, textarea)::placeholder { color: var(--ns-muted); opacity: 1; }
body.ns-marketplace :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--ns-primary) !important;
  outline-offset: 3px;
}

/* Primary actions retain one clear color in both themes. */
body.ns-marketplace :is(.bg-primary-600, .bg-primary-700, .ns-cad-post-btn, .cad-home-banner__btn--primary, a.bg-gray-900, button.bg-gray-900, button.bg-black, button.btn-secondary):not(:disabled),
html.dark body.ns-marketplace :is(.dark\:bg-primary-600, .dark\:bg-primary-700):not(:disabled) {
  background: var(--ns-primary) !important;
  color: var(--ns-on-primary) !important;
  border-color: var(--ns-primary) !important;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: none;
}
body.ns-marketplace :is(.ns-cad-post-btn, .cad-home-banner__btn--primary, a.bg-primary-600, button.bg-primary-600, button.btn-secondary):hover:not(:disabled) {
  background: var(--ns-primary-dark) !important;
  color: var(--ns-on-primary) !important;
}

body.ns-marketplace :is(.ns-cad-header, .ns-platform-nav, .ns-page-top-nav, .ns-user-nav-wrap, .ns-mobile-bottom-nav) {
  background: var(--ns-surface) !important;
  border-color: var(--ns-border) !important;
  box-shadow: var(--ns-shadow) !important;
}
body.ns-marketplace :is(.ns-platform-rail, .ns-category-nav) {
  background: var(--ns-surface-soft);
  border-color: var(--ns-border);
  box-shadow: none;
}
body.ns-marketplace :is(.ns-platform-link, .ns-platform-rail-link, .ns-category-link, .ns-user-nav-link, .ns-page-top-link, .cad-home-banner__rail-link, .cad-home-banner__btn--ghost) {
  color: var(--ns-text) !important;
  background: var(--ns-surface) !important;
  border-color: var(--ns-border) !important;
  border-radius: 8px;
  font-weight: 600 !important;
  box-shadow: none !important;
  animation: none !important;
}
body.ns-marketplace :is(.ns-platform-link, .ns-platform-rail-link, .ns-category-link, .ns-user-nav-link, .ns-page-top-link, .cad-home-banner__rail-link, .cad-home-banner__btn--ghost):hover {
  color: var(--ns-primary) !important;
  background: var(--ns-primary-soft) !important;
  border-color: var(--ns-primary) !important;
  transform: none !important;
}
body.ns-marketplace :is(.cad-home-banner__rail-link--active, .ns-user-nav-link--active, .ns-page-top-link--active) {
  background: var(--ns-primary) !important;
  color: var(--ns-on-primary) !important;
  border-color: var(--ns-primary) !important;
}
body.ns-marketplace .ns-mobile-bottom-nav-link { color: var(--ns-muted); }
body.ns-marketplace .ns-mobile-bottom-nav-link--active { color: var(--ns-primary); background: var(--ns-primary-soft); box-shadow: none; }
body.ns-marketplace .ns-mobile-bottom-nav-link:hover { color: var(--ns-primary); background: var(--ns-primary-soft); box-shadow: none; }
body.ns-marketplace :is(.ns-settings-nav-card, .ns-settings-nav-toggle) { border-color: var(--ns-border) !important; box-shadow: var(--ns-shadow); }
body.ns-marketplace .ns-settings-nav-card a { background: var(--ns-surface); color: var(--ns-text); border-color: var(--ns-border) !important; }
body.ns-marketplace .ns-settings-nav-card a:hover { background: var(--ns-primary-soft); color: var(--ns-primary); box-shadow: inset 4px 0 0 var(--ns-primary); }

body.ns-marketplace .cad-home-banner {
  background: var(--ns-surface-soft) !important;
  border-color: var(--ns-border) !important;
  border-radius: 14px;
  box-shadow: var(--ns-shadow) !important;
}
body.ns-marketplace .cad-home-banner::before, body.ns-marketplace .cad-home-banner::after { display: none; }
body.ns-marketplace .cad-home-banner__copy h1 { color: var(--ns-text); font-weight: 600; line-height: 1.25; }
body.ns-marketplace .cad-home-banner__copy p { color: var(--ns-muted); }
body.ns-marketplace .cad-home-banner__eyebrow { color: var(--ns-primary); background: var(--ns-primary-soft); border-color: var(--ns-border); font-weight: 600; }
body.ns-marketplace .cad-home-banner__chips span { color: var(--ns-text); background: var(--ns-surface); border-color: var(--ns-border); font-weight: 500; }
body.ns-marketplace .cad-home-banner__meta { color: var(--ns-muted); }
body.ns-marketplace .cad-home-banner__meta i { color: var(--ns-primary); }
body.ns-marketplace .cad-home-banner__btn { min-height: 44px; border-radius: 8px; font-weight: 600; }
body.ns-marketplace .cad-home-banner__btn:hover { transform: none; }
body.ns-marketplace .cad-market-card { border-color: var(--ns-border); box-shadow: var(--ns-shadow); animation: none; }
body.ns-marketplace :is(.cad-market-card__badge, .cad-market-card__price) { background: #245a43; color: #ffffff; border-color: #245a43; font-weight: 600; }
body.ns-marketplace .cad-home-banner__search .fi-input-wrp,
body.ns-marketplace .ns-cad-header .placeholder-muted {
  background: var(--ns-surface) !important;
  color: var(--ns-text) !important;
  border-color: var(--ns-border) !important;
  box-shadow: none;
}
body.ns-marketplace .ns-cad-header .placeholder-muted { border: 1px solid var(--ns-border) !important; border-radius: 8px; min-height: 44px; }
body.ns-marketplace .ns-cad-header .placeholder-muted::placeholder { color: var(--ns-muted) !important; }
body.ns-marketplace .ns-marketplace-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ns-text); text-decoration: none; line-height: 1.2; }
body.ns-marketplace .ns-marketplace-brand .custom-logo { width: 40px; height: 40px !important; object-fit: contain; border-radius: 8px; filter: none; }
body.ns-marketplace .ns-marketplace-brand-name { font-size: 20px; font-weight: 600; white-space: nowrap; }
body.ns-marketplace .ns-marketplace-brand-name > span { color: var(--ns-primary); }
body.ns-marketplace .ns-marketplace-brand-name small { display: block; color: var(--ns-muted); font-size: 12px; font-weight: 400; }
body.ns-marketplace .cad-home-banner__search .fi-input-wrp:focus-within { border-color: var(--ns-primary) !important; box-shadow: 0 0 0 2px var(--ns-primary-soft) !important; }
body.ns-marketplace .home-search .fi-input-wrp div:last-child { background: var(--ns-primary); }
body.ns-marketplace .home-search .fi-input-wrp .fi-icon-btn-icon { color: var(--ns-on-primary) !important; }

body.ns-marketplace :is(.ns-marketplace-card, .ns-marketplace-category) { background: var(--ns-surface) !important; color: var(--ns-text); border: 1px solid var(--ns-border); box-shadow: var(--ns-shadow); }
body.ns-marketplace :is(.ns-marketplace-card, .ns-marketplace-category):hover { border-color: var(--ns-primary); transform: none; }
body.ns-marketplace .price { background: var(--ns-primary-soft); color: var(--ns-primary); border: 1px solid var(--ns-border); border-radius: 6px; padding-inline: 8px; font-weight: 600; }
body.ns-marketplace .price::before, body.ns-marketplace .price::after { display: none; }
body.ns-marketplace .ns-marketplace-footer-cta { background: #173f2d; }
body.ns-marketplace .ns-marketplace-footer-cta a { background: #9bc6aa !important; color: #173f2d !important; border-color: #9bc6aa !important; }
body.ns-marketplace .ns-marketplace-footer-cta a:hover { background: #b8d9c3 !important; }
body.ns-marketplace .ns-marketplace-footer > .bg-white { background: var(--ns-surface); border-color: var(--ns-border); }
html.dark body.ns-marketplace :is(.dark\:bg-gray-900, .dark\:bg-gray-800, .dark\:bg-white\/5) { background-color: var(--ns-surface); }
html.dark body.ns-marketplace :is(.dark\:text-gray-500, .dark\:text-gray-400) { color: var(--ns-muted); }
html.dark body.ns-marketplace .ns-cad-header .placeholder-muted::placeholder { color: var(--ns-muted) !important; }

@media (prefers-reduced-motion: reduce) {
  body.ns-marketplace .cad-market-card img { transition: none; }
}
