/* Public-site color schemes. Keep product photos and brand artwork in their original colors. */
:root { color-scheme: light dark; }
.brand img { color-scheme: only light; object-fit: contain; }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #10181f;
    --ink: #f1f6f8;
    --text: #dce6eb;
    --muted: #afc0ca;
    --line: #344550;
    --green: #79dfa0;
    --green-dark: #a3edbe;
    --leaf: #79dfa0;
    --leaf-dark: #95e6b3;
    --shadow: 0 10px 32px #00000038;
  }

  body { background: var(--paper); color: var(--text); }
  ::selection { background: #286841; color: #fff; }
  input, select, textarea { accent-color: #79dfa0; }
  input::placeholder, textarea::placeholder { color: #9cafbb; opacity: 1; }
  button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline-color: #8be5ad;
  }

  /* Page surfaces and navigation. */
  body :is(.site-header, .hero-wrap) { background: #10181f; }
  body :is(.site-footer, .page-search-bar, .cart-group-heading, .account-order-top, .account-order-actions, .account-order-disclaimer) {
    background: #131e26;
    border-color: var(--line);
  }
  body :is(.product-card, .category-card, .cart-seller-group, .cart-summary, .item-purchase-panel,
    .account-verification-panel, .account-order-card, .account-listing-card, .account-stat, .account-mode,
    .account-payout-summary > div, .account-payout-table, .checkout-step, .checkout-order-summary,
    .review-payment-state, .demo-history-panel, .verification-card, .post-card, .contact-card, .content-faq,
    .terms-agreement, .request-preview, .filter-form select, .filter-form input) {
    background: #18242d;
    border-color: var(--line);
    color: var(--text);
  }
  body :is(.empty-state, .cart-empty, .checkout-empty, .account-empty-history, .account-history-locked,
    .account-device-note, .account-demo-session-note, .page-preview-note, .verify-service-note,
    .post-check-rules, .checkout-access-note, .checkout-fields.checkout-locked .checkout-step) {
    background: #16232d;
    border-color: #3b5261;
    color: #bdcdd6;
  }
  body :is(.header-search, .search-form, .post-field input, .post-field select, .post-field textarea,
    .checkout-field input, .checkout-field select, .checkout-field textarea, .account-profile-form input,
    .verify-input-row input, .verify-phone-field, .filter-form input, .filter-form select) {
    background: #101d26;
    border-color: #536976;
    color: #f1f6f8;
  }
  body :is(.search-field input, .sort-control select, .checkout-phone-field input) { color: #f1f6f8; }
  body :is(.verify-country, .account-payout-table th) { background: #23343e; color: #dce6eb; }
  body :is(.search-field input::placeholder, .header-search .search-field input::placeholder,
    .checkout-field input::placeholder, .checkout-field textarea::placeholder) { color: #9cafbb; }
  body :is(.mobile-nav, .item-mobile-purchase) { background: #14212bf7; border-color: #425562; }
  body :is(.mobile-nav > a, .mobile-nav > button, .main-nav .location-button, .location-button, .search-field) {
    color: #c0d0d8;
  }
  body :is(.mobile-nav > a:first-child, .nav-active) { color: var(--green); }
  body :is(.cart-count, .saved-count) { border-color: #14212b; }
  body .saved-count { background: #176c3c; color: #fff; }
  body :is(.icon-button:hover, .filter-button:hover, .quantity-control button:hover) { background: #253844; }

  /* Headings, prices and field labels stay brighter than supporting copy. */
  body :is(.product-price, .product-title, .category-name, .cart-item-title, .cart-row-total,
    .cart-summary dd, .cart-summary .cart-subtotal, .cart-summary .cart-subtotal dd,
    .cart-single-quantity strong, .item-facts dd, .community-strip strong,
    .receive-copy strong, .checkout-field, .checkout-total, .checkout-line-item > strong,
    .checkout-line-description > a, .summary-price-lines strong, .checkout-sublegend,
    .request-preview-details dd, .request-preview-pricing dd, .request-preview-pricing .request-preview-total,
    .request-preview-header h2, .request-preview-columns h3, .review-payment-state > strong,
    .demo-history-panel h3, .inspect-payment h3, .checkout-terms-body h3, .pickup-address h3,
    .terms-agreement > span, .verify-label, .verify-service-note strong,
    .account-order-items strong, .account-line-total, .account-order-total,
    .account-detail-label, .account-order-totals dd, .account-profile-form .checkout-field,
    .account-device-note strong, .account-demo-session-note strong, .account-demo-disclosure strong,
    .post-field, .post-fieldset legend, .post-radio, .post-check) { color: #edf4f7; }

  body :is(.muted, .category-count, .section-subtitle, .sort-control, .clear-filters,
    .hero-description, .hero-kicker, .hero-example-note, .hero-local-note,
    .product-attributes, .product-bottom, .listing-bottom > p, .how-intro > p, .how-steps p,
    .footer-brand p, .footer-column a, .footer-column button, .footer-bottom,
    .dialog-copy p, .dialog-copy ul, .dialog-copy ol, .detail-meta, .filter-reset,
    .page-loading p, .breadcrumbs, .breadcrumbs > [aria-current], .photo-caption, .item-meta,
    .item-price-caption, .seller-kicker, .seller-panel p, .item-handover p, .item-description > p,
    .item-facts dt, .item-safety p, .item-delivery-note, .page-state > p,
    .cart-page-heading p, .cart-group-heading p, .seller-items-count, .cart-item-meta,
    .cart-single-quantity, .cart-single-quantity > span, .cart-remove, .cart-summary dl > div,
    .cart-summary .summary-delivery dd, .summary-explainer, .summary-nonbinding,
    .cart-availability-note, .cart-empty > p, .cart-empty p.cart-empty-note, .quantity-limit,
    .mobile-price-label, .cart-nonbinding,
    .account-breadcrumb, .account-kicker, .account-panel-intro, .account-history-locked p,
    .account-locked-badge, .account-dashboard-heading p, .account-section-heading p,
    .account-empty-history p, .account-sidebar-card > p, .account-order-heading p,
    .account-order-reference, .account-order-reference > span:last-child,
    .account-order-items li > div > span, .account-order-preferences > p:not(.account-payment-state),
    .account-pickup-preference > span, .account-pickup-preference p, .account-order-totals > div,
    .account-order-address, .account-order-actions span, .account-member-since,
    .account-saved-list small, .account-saved-empty, .account-loading, .account-listing-top p,
    .account-listing-next, .account-order-phone, .account-mode small, .account-mode svg,
    .account-stat-label, .account-stat-note, .account-past-orders summary,
    .account-payout-summary span, .account-payout-table small, .account-seller-facts dt,
    .account-sidebar-text, .account-demo-disclosure,
    .checkout-breadcrumbs, .checkout-breadcrumbs > [aria-current], .checkout-kicker,
    .checkout-heading > div > p, .checkout-step-heading p, .receive-copy > span,
    .delivery-rule, .delivery-rule strong, .pickup-address p, .pickup-address span,
    .field-required, .field-optional, .checkout-field-note, .checkout-line-description p,
    .inspect-payment p, .checkout-terms-body p, .checkout-submit-note, .terms-agreement strong,
    .summary-price-lines > div, .summary-delivery-message, .pay-later-note span,
    .checkout-summary-preview, .checkout-empty p, .request-preview-header p,
    .request-preview-intro, .request-preview-details dt, .request-preview-pricing > div,
    .request-preview-payment, .request-preview-footer p, .review-payment-state > p,
    .demo-history-panel > div > p, .demo-order-save-status, .request-preview-items small,
    .request-preview-footnote, .payment-checking,
    .verification-card p, .verify-kicker, .verify-tabs button, .verify-hint,
    .post-heading p, .post-steps, .post-intro, .post-field .field-required,
    .post-field .field-optional, .post-radio small, .post-photo-add small,
    .post-photo-note, .post-small, .post-done p, .post-loading,
    .content-heading p, .content-section p, .content-steps, .content-list,
    .content-note, .content-small, .contact-card p, .content-faq p) { color: #b4c5cf; }

  body :is(.nav-border, .product-bottom, .footer-bottom, .item-description, .item-facts > div,
    .seller-panel, .item-handover, .item-safety, .cart-item, .cart-summary dl > div,
    .account-contact-list li, .account-order-items li, .account-order-details,
    .account-order-totals, .account-seller-facts > div, .checkout-line-item,
    .checkout-total, .summary-price-lines, .verify-tabs, .content-heading,
    .content-section, .content-faq, .post-steps, .post-fieldset,
    .item-utility-actions .save-item, .item-share, .cart-row + .cart-row,
    .cart-single-quantity strong, .quantity-control, .account-demo-disclosure,
    .account-order-totals .account-order-total, .account-listings-section,
    .account-payout-table td, .checkout-terms, .request-preview-pricing .request-preview-total,
    .request-preview-footer, .request-preview-items, .request-preview-items li) { border-color: var(--line); }

  /* Green accents use readable text colors and deeper surfaces. */
  body :is(.preview-bar, .community-strip, .account-welcome, .account-sidebar-card,
    .verification-active, .verify-code-example, .contact-card-whatsapp,
    .checkout-preview-notice, .pickup-address, .pickup-location-card, .inspect-payment,
    .pay-later-note, .account-return-note, .account-payout-note, .account-listing-fee,
    .account-fee-notice, .account-order-paid, .dialog-note) {
    background: #163427;
    border-color: #345e48;
    color: #c5edd3;
  }
  body :is(.account-welcome > p, .account-welcome .account-kicker, .account-welcome-points,
    .checkout-preview-notice strong, .pickup-location-card p, .pickup-location-card strong,
    .account-welcome-points svg, .account-sidebar-card > p, .account-device-note strong,
    .account-return-note, .verify-code-example, .community-strip strong) { color: #caeed6; }
  body .dialog-note { color: #caeed6 !important; }
  body :is(.product-cart-button, .product-cart-button.in-cart, .filter-chip, .condition,
    .tab.active, .account-mode.is-active, .receive-option.selected, .item-negotiable,
    .account-status-badge.status-active, .account-status-badge.status-done) {
    background: #173d2b;
    border-color: #477456;
    color: #a6efbd;
  }
  body :is(.product-cart-button:hover, .hero-sell-button:hover) { background: #245437; }
  body :is(.tab, .account-preview-badge, .account-status-badge.status-ended, .account-contact-list small,
    .summary-preview-label, .account-order-count, .cart-heading-count, .listing-example-label,
    .account-history-locked > span:first-child) {
    background: #24343f;
    border-color: #435967;
    color: #d4e0e6;
  }
  body :is(.step-icon, .seller-avatar, .cart-seller-icon, .safety-icon, .page-state-icon,
    .account-welcome-icon, .account-profile-icon, .account-empty-icon, .account-sidebar-icon,
    .account-order-icon, .checkout-step-number, .receive-icon, .checkout-summary-icon,
    .checkout-empty-icon, .verification-symbol, .contact-card-icon,
    .contact-card-whatsapp .contact-card-icon) { background: #244b35; color: #b3f0c7; }
  body :is(.one-off-note, .seller-shop, .verify-tabs button[aria-pressed=true],
    .post-steps li.is-done, .post-status, .account-form-status) { color: #9ce7b5; }
  body :is(.hero-local-note strong, .hero-local-note .icon, .inspect-payment > span) { color: #a4e4b9; }
  body .hero { background: #182e25; border-color: #3c5649; }
  body .hero-sell-button { background: #203c2d; border-color: #56755f; color: #daf5e3; }
  body .hero-local-icon { background: #254331; border-color: #4b6e55; color: #b3edc5; }
  body .hero-brand-tile { background: #126737; color: #fff; }
  body .hero-brand-tile > span:last-child { color: #d2f0dc; }
  body .step-number { color: #7893a4; }
  body .preview-divider { color: #88b99b; }

  /* Action colors remain distinct from the lighter link colors. */
  body .button-primary { background: #087835; color: #fff; }
  body .button-primary:hover { background: #09642f; }
  body .header-sell { background: #c92029; color: #fff; }
  body .header-sell:hover { background: #aa1821; }
  body :is(.button-outline, .hero-sell-button, .filter-button) { border-color: #56705f; }
  body .button-outline { background: #1b2c33; color: #dcf4e4; }
  body .button-outline:hover { background: #294138; }
  body .button-white { background: #f3fbf5; color: #145c2e; }
  body .sell-banner { background: #9e1924; color: #fff; }
  body .sell-banner > .button { background: #fff; color: #9e1924; }
  body .sell-banner p { color: #ffe4e6; }
  body :is(.sell-fee, .mini-tag) { background: #fff; color: #176537; }
  body .mobile-nav .mobile-sell > svg { color: #fff; }
  body :is(.post-steps li.is-current span) { background: #176d3a; color: #fff; }
  body :is(.post-steps li.is-done span, .post-done-icon) { background: #244b35; color: #b3f0c7; }
  body :is(.post-photo-add, .post-video-add) { background: #162b22; border-color: #5f866b; color: #a6efbd; }

  /* Pending, error and disabled states retain their meaning. */
  body :is(.pending-badge, .listing-pending-label, .cart-pending-label, .checkout-line-pending,
    .account-status-badge.status-hold, .item-pending-note, .item-hold-box, .cart-hold-block,
    .account-order-hold, .account-listing-feedback, .account-fee-notice.is-warning,
    .account-stat-warn, .checkout-blocked-note, .payment-test-note, .checkout-waiting,
    .request-preview-waiting, .post-feedback, .post-revision-note) {
    background: #3a2b13;
    border-color: #88642e;
    color: #ffdfa1;
  }
  body :is(.item-hold-head, .item-hold-timer .hold-timer-value, .item-hold-small,
    .one-off-note .hold-timer, .account-payment-state, .account-stat-warn .account-stat-value,
    .checkout-waiting-row, .checkout-waiting-row small, .verify-memory-note) { color: #ffdfa1; }
  body .cart-hold-block.cart-hold-info { background: #1c303f; border-color: #47647b; color: #d2e2ef; }
  body .cart-hold-info strong { color: #e7f0f7; }
  body :is(.checkout-error, .verify-status.is-error) { background: #3e2226; border-color: #94565c; color: #ffb9b4; }
  body :is(.account-form-status.is-error, .account-inline-danger, .post-status.is-error, .cart-clear:hover) { color: #ffaaa4; }
  body .delivery-unavailable { background: #3b2b22; border-color: #8a6650; color: #f7cfb2; }
  body :is(.unavailable-payment:disabled, .demo-history-panel > .button:disabled) {
    background: #293740; border-color: #566875; color: #bbcbd4;
  }

  /* Original photos and logos keep a light backing; do not invert the image files. */
  body :is(.product-photo, .item-photo, .category-card.has-image .category-icon,
    .item-thumb:not(.item-thumb-video), .cart-item-image, .checkout-line-photo, .post-photo) {
    color-scheme: only light;
    background: #fff;
  }
  body .category-icon:not(:has(img)) { background: #273c33; color: #c7ecd3; }
  body :is(.save-item, .post-photo-remove, .post-photo-main, .sample-badge, .dialog-close) {
    background: #21323df2;
    border-color: #647c8a;
    color: #e9f1f5;
  }
  body .save-item.saved { color: #a6efbd; }
  body .item-photo figcaption > span { background: #21323ded; color: #e2ecef; }
  body .item-photo figcaption > span:last-child { background: #21323ded; color: #fff; }
  body dialog { background: #18242d; border: 1px solid #4a5e6b; color: #dce6eb; }
  body .skip-link { background: #18242d; color: #eaf4ed; }
  body :is(.toast, .dialog-status) { background: #dcebe2; color: #142b1c; }
}
