/* Storefront surface material only. Native controls, layout and visibility stay owned
   by the existing templates. Covers are never filtered; blur only each outer pane. */
@media (forced-colors: none) {
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content .panel {
    background: #292e32f0 !important;
    border-color: var(--em-edge, #ffffff52) !important;
    box-shadow: var(--em-shadow), 0 0 0 1px #ffffff14, 0 0 16px #e8f2ff0d !important;
    color: #fafafa;
    text-shadow: 0 1px 3px #00000070;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .dark-detail-cover {
    background: linear-gradient(135deg, #ffffff0b, #00000012) !important;
    border-color: #ffffff52;
    box-shadow: inset 0 1px 0 #ffffff26;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .dark-detail-badges .badge-soft {
    background: #10161d55 !important;
    color: #fafafa !important;
    border-color: #ffffff52 !important;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content :is(input.form-control, textarea.form-control, select.form-control, select.form-select, .qty-group) {
    background: linear-gradient(135deg, #ffffff0b, #00000024) !important;
    border-color: #ffffff66 !important;
    box-shadow: inset 0 1px 1px #ffffff24 !important;
    color: #fafafa !important;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content .qty-group .form-control {
    background: transparent !important;
    box-shadow: none !important;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content :is(.change-num-sub, .change-num-add) {
    background: #ffffff0d !important;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content :is(input.form-control, textarea.form-control)::placeholder {
    color: #e3e6e8 !important;
    opacity: 1;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content :is(input.form-control, textarea.form-control, select.form-control, select.form-select):focus {
    border-color: #e8fff2 !important;
    box-shadow: 0 0 0 3px #e8fff22b !important;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content select option {
    background: #292e32;
    color: #fafafa;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content input:-webkit-autofill {
    -webkit-text-fill-color: #fafafa;
    box-shadow: 0 0 0 1000px #303636 inset !important;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content .pay-list .pay {
    background: linear-gradient(135deg, #ffffff18, #ffffff06) !important;
    border-color: #ffffff66 !important;
    box-shadow: inset 0 1px 1px #ffffff38;
    text-shadow: 0 1px 3px #00000070;
  }
  body.eo-enabled.em-enabled[data-production-page="item"] .ep-content .pay-list .pay:hover {
    background: linear-gradient(135deg, #ffffff2b, #ffffff13) !important;
    border-color: #edfff5 !important;
  }

  /* Keep product artwork fully opaque and sharp. Only the lower information
     surface samples the background, avoiding a large blur behind every image. */
  body.eo-enabled.em-enabled.eg-enabled .eg-products .acg-card,
  body.eo-enabled.em-enabled.eg-enabled .eg-products a:hover .acg-card {
    background: transparent;
    border-color: var(--em-edge, #ffffff52);
    box-shadow: var(--em-shadow), 0 0 0 1px #ffffff14, 0 0 16px #e8f2ff0d;
  }
  body.eo-enabled.em-enabled.eg-enabled .eg-products .acg-card > .p-3 {
    background: #292e32f0;
    box-shadow: inset 0 1px 0 #ffffff26;
    text-shadow: 0 1px 3px #00000070;
    color: #fafafa;
  }
  body.eo-enabled.em-enabled.eg-enabled .eg-products .stat-bottom {
    color: #f5f7fa;
  }
  body.eo-enabled.em-enabled.eg-enabled .eg-products .goods-title {
    color: #fff;
  }
  body.eo-enabled.em-enabled.eg-enabled .eg-products .dark-card-action {
    color: #fff;
    background: linear-gradient(135deg, #ffffff13, #ffffff05);
    border-color: #ffffff66;
    box-shadow: inset 0 1px 0 #ffffff24;
  }
  /* The native sold-out opacity creates its own backdrop root. A stronger tint
     keeps that existing disabled state readable instead of exposing sharp art. */
  body.eo-enabled.em-enabled.eg-enabled .eg-products .acg-card.soldout > .p-3 {
    background: linear-gradient(145deg, #343b42f0, #22282deb);
  }
  @media (hover: hover) {
    body.eo-enabled.em-enabled.eg-enabled .eg-products a:hover .acg-card {
      border-color: #ffffff94;
      box-shadow: var(--em-shadow), 0 0 0 1px #ffffff26, 0 0 18px #e8f2ff1a;
    }
    body.eo-enabled.em-enabled[data-production-page="item"] .ep-content .panel:hover {
      border-color: #ffffff80 !important;
      box-shadow: var(--em-shadow), 0 0 0 1px #ffffff26, 0 0 18px #e8f2ff1a !important;
    }
  }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.eo-enabled.em-enabled[data-production-page="item"] .ep-content .panel {
      background: var(--em-glass) !important;
      -webkit-backdrop-filter: var(--em-glass-filter);
      backdrop-filter: var(--em-glass-filter);
    }
    body.eo-enabled.em-enabled.eg-enabled .eg-products .acg-card > .p-3 {
      background: var(--em-glass);
      -webkit-backdrop-filter: var(--em-glass-filter);
      backdrop-filter: var(--em-glass-filter);
    }
    body.eo-enabled.em-enabled.eg-enabled .eg-products .acg-card.soldout > .p-3 {
      background: linear-gradient(145deg, #343b42f0, #22282deb);
    }
  }
}

/* Order delivery content only. The legacy white wrappers were left behind
   when production-pages.css made .card-display transparent with light text.
   Keep lookup, password gating, download/copy handlers and visibility native. */
body[data-production-page="query"] .order-item :is(.card-content, .card-content-no-password, .card-display-content) {
  background: rgba(16, 22, 29, .78) !important;
  color: #f5f7fa !important;
  border-color: rgba(255, 255, 255, .24) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  text-shadow: none !important;
  /* Only the parent order panel blurs; avoid nested blur on long deliveries. */
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body[data-production-page="query"] .order-item :is(.card-display, .card-text) {
  background: transparent !important;
  color: #f5f7fa !important;
  border-color: rgba(255, 255, 255, .16) !important;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  min-width: 0;
  max-width: 100%;
  text-shadow: none !important;
  user-select: text;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body[data-production-page="query"] .order-item .card-section {
  --acg-delivery-accent: #c9dff6;
  --acg-delivery-on-accent: #111c29;
  --acg-delivery-accent-soft: rgba(201, 223, 246, .1);
  --acg-delivery-surface: rgba(255, 255, 255, .035);
  --acg-delivery-border: rgba(255, 255, 255, .24);
  --acg-delivery-success: #a3edc9;
}

body[data-production-page="query"] .order-item :is(.acg-delivery__name, .acg-delivery__copy) {
  color: #f5f7fa;
}
body[data-production-page="query"] .order-item .acg-delivery__copy { background: transparent; }
body[data-production-page="query"] .order-item .acg-delivery__sub { color: #dce2e9; opacity: 1; }
body[data-production-page="query"] .order-item .acg-delivery__copy.is-done { color: #a3edc9; }

body[data-production-page="query"] .order-item :is(.card-display a, .card-text a, .acg-delivery__url) {
  color: #c9dff6 !important;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: .2em;
}
body[data-production-page="query"] .order-item .card-section :is(a, button):focus-visible {
  outline: 2px solid #c9dff6;
  outline-offset: 3px;
}
body[data-production-page="query"] .order-item :is(.card-display, .card-text)::selection {
  background: #294b6d;
  color: #fff;
}

/* Readability does not depend on backdrop-filter support. High contrast mode
   follows the user's system palette instead of pinning our dark colors. */
@media (forced-colors: active) {
  body[data-production-page="query"] .order-item :is(.card-content, .card-content-no-password, .card-display-content, .card-display, .card-text, .acg-delivery__file, .acg-delivery__copy) {
    background: Canvas !important;
    color: CanvasText !important;
    border-color: CanvasText !important;
    box-shadow: none;
  }
  body[data-production-page="query"] .order-item :is(.acg-delivery__name, .acg-delivery__sub) { color: CanvasText !important; }
  body[data-production-page="query"] .order-item :is(.card-display a, .card-text a, .acg-delivery__url) { color: LinkText !important; }
  body[data-production-page="query"] .order-item .card-section :is(a, button):focus-visible { outline-color: Highlight; }
}
