/* CardMark's shared adventure finish. Paint only: navigation, chart data, layout,
   semantic gain/loss colors and TCG realm art remain owned by their components. */
body#cardmarkApp.cm-adventure {
  --cm-gold: #efd08a;
  --cm-cyan: #62deeb;
  --cm-edge: #3d8294;
  --cm-surface: linear-gradient(145deg, #103344, #071d2c 75%);
  --cm-inset: inset 0 1px 0 #d7f9ff20, inset 0 0 20px #36d6e309;
}

/* Headers carry the scenery; dense data surfaces stay quiet. */
body#cardmarkApp.cm-adventure :is(#collection .collection-modern-head, #wishlist .wishlist-modern-head,
  #sealed .sealed-search-brand, #market .market-intel-hero, #seller .seller-hero-heading,
  #ownerValidation .owner-validation-hero) {
  background: linear-gradient(90deg, #071e2eea, #071e2e9c),
    url('/app/assets/trainer-quest-world.webp') center 46% / cover !important;
  border-top: 1px solid #bda773;
  border-bottom: 1px solid #3f8798;
  border-radius: 16px;
  padding: 16px 10px !important;
  box-shadow: var(--cm-inset), 0 4px 16px #00121d30;
}
body#cardmarkApp.cm-adventure :is(.cm-page-kicker, .dashboard-kicker, .history-brand-mark,
  .cm-select-kicker, .history-filter-kicker) { color: var(--cm-gold); }
body#cardmarkApp.cm-adventure :is(.cm-page-title, .history-kicker) { text-shadow: 0 2px 8px #00121d99; }
body#cardmarkApp.cm-adventure :is(#collection, #wishlist, #sealed) .cm-count-badge {
  border-color: var(--cm-gold) !important;
  box-shadow: var(--cm-inset), 0 0 12px #edc76c20;
}

/* Shared tools, settings, onboarding, import, offers and account dialogs. */
body#cardmarkApp.cm-adventure :is(.panel, .sheet, .modal-card, .cm-select-sheet,
  .set-history-window, .sl-dialog, .cm-market, .cm-offer) {
  border-color: var(--cm-edge);
  border-top-color: #c5af77;
  background-color: #081e2d;
  background-image: radial-gradient(ellipse at 10% 0, #1a526644, transparent 65%);
  box-shadow: var(--cm-inset), 0 12px 32px #00101b40;
}
body#cardmarkApp.cm-adventure :is(.sheet, .cm-select-sheet, .set-history-window, .sl-dialog, .cm-market, .cm-offer) {
  border: 1px solid var(--cm-edge) !important;
  border-top-color: var(--cm-gold) !important;
  background-color: #081e2d !important;
  background-image: radial-gradient(ellipse at 10% 0, #1a526644, transparent 65%) !important;
}
body#cardmarkApp.cm-adventure :is(.sheet, .cm-select-sheet, .sl-dialog, .cm-market, .cm-offer) :is(h2, h3) {
  text-shadow: 0 1px 6px #00121d80;
}
body#cardmarkApp.cm-adventure :is(.panel-title-row, .market-section-head, .seller-inventory-head,
  .grading-analyzer-head, .cm-section-heading, .current-offer-head, .cm-select-head,
  .work-details-head, .seller-chart-title) { border-bottom-color: #b8a46970; }

/* Matching cyan frames and tiny gold corner inlays on card/item surfaces.
   Gradients avoid pseudo-elements used by selection badges and ownership states. */
body#cardmarkApp.cm-adventure :is(#collection, #wishlist, #sealed, #seller, #market, #dashboard, #cmMarket, #setLadderDialog)
  :is(.collection-card-modern, .wishlist-card-modern, .sealed-card-modern, .seller-master-card,
    .market-card, .market-stage-card, .top-value-card, .cm-seller-card, .cm-discover-card, .sl-card):not(.selected) {
  border-color: #40bdcc !important;
  background-color: #082433 !important;
  background-image:
    linear-gradient(var(--cm-gold), var(--cm-gold)), linear-gradient(var(--cm-gold), var(--cm-gold)),
    linear-gradient(var(--cm-gold), var(--cm-gold)), linear-gradient(var(--cm-gold), var(--cm-gold)),
    radial-gradient(ellipse at 50% 0, #16607055, transparent 75%) !important;
  background-size: 12px 2px, 2px 12px, 12px 2px, 2px 12px, 100% 100% !important;
  background-position: left 7px top 7px, left 7px top 7px, right 7px top 7px, right 7px top 7px, center !important;
  background-repeat: no-repeat !important;
  box-shadow: var(--cm-inset), 0 3px 12px #00101b35 !important;
}
body#cardmarkApp.cm-adventure :is(#collection, #wishlist, #sealed, #seller) .selected {
  border-color: var(--cm-gold) !important;
  box-shadow: inset 0 0 0 1px var(--cm-gold), 0 0 12px #efd08a28 !important;
}
body#cardmarkApp.cm-adventure :is(.collection-binder-media, .wishlist-card-image, .sealed-product-image,
  .seller-master-image, .card-data-preview, .seller-detail-media) {
  background-image: radial-gradient(ellipse at 50% 90%, #3ad8e21c, transparent 70%);
}

/* Value panels: preserve component text colors for returns and alert states. */
body#cardmarkApp.cm-adventure :is(.collection-modern-summary, .wishlist-modern-summary, .collection-set-focus,
  .seller-inventory-hero, .seller-perf-kpi, .seller-detail-info-card, .seller-detail-pricing-card,
  .market-insight-tile, .market-history-panel, .market-lifecycle-panel, .market-backtest-panel,
  .market-explain-panel, .market-set-risk-card, .sealed-analytics-panel, .sealed-metric-card,
  .history-population, .history-pull-rates, .work-card, .show-perf-card, .data-health-card,
  .owner-validation-card, .growth-registration-panel, .referral-status-card, .card-lore-panel,
  .portfolio-breakdown-panel, .dashboard-subwindow, .sh-panel) {
  border-color: #447a89 !important;
  border-top-color: #b5a171 !important;
  box-shadow: var(--cm-inset), 0 3px 10px #00131e25;
}
body#cardmarkApp.cm-adventure :is(.portfolio-kpi-strip, .history-kpi-strip, .set-history-kpis,
  .sealed-summary-metrics, .grading-analyzer-kpis, .sl-summary) > :is(article, div) {
  border-color: #427788;
  border-bottom-color: #b5a171;
  background-image: linear-gradient(135deg, #19465335, #d2b55b08);
  box-shadow: inset 0 1px #adf4f313;
}

/* Search/filters across the app, including inputs in dynamically created tools.
   background-color leaves native arrows and component icons intact. */
body#cardmarkApp.cm-adventure :is(#appView, .sheet, .modal-card, dialog, .cm-select-sheet)
  :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]), select, textarea) {
  border-color: #477e90;
  background-color: #0b283a;
}
body#cardmarkApp.cm-adventure :is(.collection-modern-filters, .wishlist-modern-filters, .sealed-modern-toolbar) label {
  border-color: #568b97 !important;
  border-top-color: #c5ae75 !important;
  background: var(--cm-surface) !important;
  box-shadow: inset 0 1px #fff2;
}
body#cardmarkApp.cm-adventure :is(.cm-search-field, .sealed-search-wrap, .market-search-input) {
  border-color: #54cfda !important;
  box-shadow: inset 0 1px #bef8ff22, 0 0 9px #2edbea13;
}
body#cardmarkApp.cm-adventure :is(.sheet, #appView, dialog) :is(input, select, textarea):focus-visible,
body#cardmarkApp.cm-adventure :is(button, summary, a):focus-visible {
  outline: 2px solid var(--cm-gold) !important;
  outline-offset: 3px;
}
body#cardmarkApp.cm-adventure .cm-select-chevron { border-color: var(--cm-gold); }
body#cardmarkApp.cm-adventure .cm-select-option.active {
  border-color: var(--cm-gold); box-shadow: inset 0 0 0 1px #efd08a25;
}

/* Buttons: keep danger, buy/sell, disabled, public/private and semantic colors. */
body#cardmarkApp.cm-adventure :is(.btn, .collection-card-history, .seller-tool, .market-tool-card, .sh-launch)
  :is(svg) { filter: drop-shadow(0 1px 2px #00121d50); }
body#cardmarkApp.cm-adventure :is(.btn, .collection-card-history, .seller-tool, .market-tool-card, .sh-launch):not(.danger):not(.bulk-remove):not([disabled]) {
  border-top-color: #bca976;
  box-shadow: inset 0 1px #bdeff318, 0 2px 6px #00121d22;
}
body#cardmarkApp.cm-adventure .btn.primary:not(.danger):not([disabled]):not(.seller-txn-buy-btn):not(.seller-txn-sell-btn) {
  background: linear-gradient(#37dce7, #079ab6);
  border-color: #78e9ed;
  box-shadow: inset 0 1px #fff7, 0 0 10px #28dce82a;
}
body#cardmarkApp.cm-adventure :is(.search-catalog-toggle, .collection-scope-switch, .collection-ownership-switch,
  .collection-layout-switch, .seller-workspace-tabs, .seller-inventory-kinds, .history-range-pills,
  .sealed-analytics-tabs, .set-history-ranges) { border-top-color: #bda66e; }
body#cardmarkApp.cm-adventure :is(.search-catalog-toggle, .collection-scope-switch, .collection-ownership-switch,
  .collection-layout-switch, .seller-workspace-tabs, .seller-inventory-kinds, .history-range-pills,
  .sealed-analytics-tabs, .set-history-ranges) button:is(.active, [aria-pressed=true], [aria-selected=true]) {
  box-shadow: inset 0 -2px var(--cm-gold), inset 0 1px #e2ffff55, 0 0 8px #2cd9e51c;
}

/* Price History: a framed exhibit, with quiet chart backgrounds and intact data. */
body#cardmarkApp.cm-adventure #history .history-window {
  border-color: #4d97a7 !important;
  border-top-color: var(--cm-gold) !important;
  background: radial-gradient(ellipse at top right, #12485c80, transparent 45%), #071b29 !important;
  box-shadow: var(--cm-inset), 0 8px 24px #00111d50;
}
body#cardmarkApp.cm-adventure #history .history-redesign-head {
  border-bottom: 1px solid #bea56d60;
  background: linear-gradient(90deg, #072333ed, #07233399),
    url('/app/assets/trainer-quest-world.webp') center 45% / cover;
  border-radius: 12px;
}
body#cardmarkApp.cm-adventure #history .history-card-image {
  border: 1px solid var(--cm-gold) !important;
  box-shadow: 0 0 0 3px #3bd5df18, 0 4px 14px #00101b70 !important;
}
body#cardmarkApp.cm-adventure #history #historyHeroPrice { color: #ffe4a5; text-shadow: 0 0 12px #e5bf5020; }
body#cardmarkApp.cm-adventure #history :is(.history-chart-panel, .history-variant-filters, .history-fair-compare) {
  border-color: #3f7c8c !important;
  border-top-color: #bba56f !important;
  box-shadow: inset 0 1px #9ef5f313;
}
body#cardmarkApp.cm-adventure #history .history-hero-action:not(.danger) {
  border-color: #4f8798 !important;
  border-top-color: #c3ad75 !important;
  background-image: linear-gradient(145deg, #17415444, #071d2c22);
}
body#cardmarkApp.cm-adventure #history .history-identity-chip.active { box-shadow: inset 0 -2px var(--cm-gold); }
body#cardmarkApp.cm-adventure :is(.history-table-section, .seller-table-wrap, .sh-table) { border-color: #437b89; }
body#cardmarkApp.cm-adventure :is(.history-table-section, .seller-table, .sh-table) th { color: #e7d295; }

/* App chrome and compact tool headers. No image treatment on camera viewfinders. */
body#cardmarkApp.cm-adventure .top { border-bottom-color: #a99158; box-shadow: 0 2px 10px #00101b35; }
body#cardmarkApp.cm-adventure :is(.bottom, .bottom-nav) { border-top-color: #a99158; }
body#cardmarkApp.cm-adventure :is(.login-auth-panel, .onboarding-panel, .activation-journey, .plan-status-card) {
  border-top-color: var(--cm-gold); box-shadow: var(--cm-inset);
}
@media (max-width: 400px) {
  body#cardmarkApp.cm-adventure :is(#collection .collection-modern-head, #wishlist .wishlist-modern-head,
    #sealed .sealed-search-brand, #market .market-intel-hero, #seller .seller-hero-heading) {
    padding: 12px 6px !important;
  }
}
