/* Presentation-only pilot: shared shell, Beta Home, Inventory and player views.
   Keep route visibility, entitlements, sticky positioning, images and actions in
   their owning stylesheets. Welcome styling lives in welcome-theme.css;
   seller workflows retain their own theme.
   Removing this link and the body attribute fully rolls back this pilot. */
body[data-ui-theme="clean-kelly"] {
  /* Owner-supplied tokens, mapped to existing components. Keep the existing
     responsive layouts instead of the supplied universal spacing reset. */
  --canvas-base: #ffffff;
  --surface-elevate: #f8fafc;
  /* Original navy wordmark body color; retain the prior relative shade roles. */
  --primary-accent: #042d4b;
  --hover-anchor: #03243c;
  --deep-contrast: #021422;
  --light-tint-accent: #f0f7fd;
  --border-divider: #e2e8f0;
  --primary-text: #0f172a;
  --secondary-text: #64748b;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 5%);
  --radius-md: 8px;
  --radius-lg: 12px;
  --ck-action: var(--primary-accent);
  --ck-hover: var(--hover-anchor);
  --ck-anchor: var(--deep-contrast);
  --ck-wash: var(--light-tint-accent);
  --ck-canvas: var(--canvas-base);
  --ck-surface: var(--surface-elevate);
  --ck-border: var(--border-divider);
  --ck-text: var(--primary-text);
  --ck-muted: var(--secondary-text);
  --ck-shadow: var(--shadow-sm);
  background: var(--ck-canvas);
}

body[data-ui-theme="clean-kelly"] :is(.sidebar, .mobile-footer-nav, #collectorHome, #inventoryPage, #playerResearchPage, #cardDetail) {
  --font-sans: var(--font-family);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body[data-ui-theme="clean-kelly"] :is(.sidebar, .mobile-footer-nav, #collectorHome, #inventoryPage, #playerResearchPage, #cardDetail) :is(button, input, select, textarea, h1, h2, h3, h4) { font-family: var(--font-family); }

/* Scope legacy variables to the selected screens, not every product workflow. */
body[data-ui-theme="clean-kelly"] :is(#collectorHome, #inventoryPage, #playerResearchPage, #cardDetail) {
  --ink: var(--ck-text);
  --muted: var(--ck-muted);
  --paper: var(--ck-surface);
  --card: var(--ck-canvas);
  --line: var(--ck-border);
  --green: var(--ck-anchor);
  --lime: var(--ck-action);
  color: var(--ck-text);
}

/* Neutral shell; keep the actual brand asset and all navigation semantics. */
body[data-ui-theme="clean-kelly"] .sidebar {
  background: var(--ck-surface);
  color: var(--ck-text);
  border-color: var(--ck-border);
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] .sidebar :is(.nav-link, .side-menu-button, .usage-menu-button, .desktop-sidebar-toggle) {
  color: var(--ck-text);
  text-shadow: none;
  box-shadow: none;
  border-radius: 8px;
  font-weight: 500;
}
body[data-ui-theme="clean-kelly"] .sidebar :is(.nav-link:not(.active):hover, .side-menu-button[aria-expanded="true"]) {
  color: var(--ck-hover);
  background: var(--ck-wash);
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] .sidebar .nav-link.active {
  background: var(--ck-action);
  color: var(--ck-canvas);
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] .sidebar :is(.side-menu-button, .usage-menu-button, .mode-switcher select, .desktop-sidebar-toggle) {
  background: var(--ck-canvas);
  border-color: var(--ck-border);
  color: var(--ck-text);
}
body[data-ui-theme="clean-kelly"] .sidebar :is(nav > p, .mode-switcher, .nav-coming-soon small) {
  color: var(--ck-muted);
}
body[data-ui-theme="clean-kelly"] :is(.more-menu, .usage-menu) {
  background: var(--ck-canvas);
  border-color: var(--ck-border);
  box-shadow: 0 8px 24px rgb(15 23 42 / 10%);
}
body[data-ui-theme="clean-kelly"] .more-menu .sign-out {
  background: var(--ck-anchor);
  color: #fff;
}
body[data-ui-theme="clean-kelly"] .app-page-kicker { color: var(--ck-muted); }
body[data-ui-theme="clean-kelly"] :is(.mobile-footer-nav, .page-back-arrow) {
  background: var(--ck-canvas);
  color: var(--ck-text);
  border-color: var(--ck-border);
  box-shadow: 0 -2px 10px rgb(15 23 42 / 4%);
}
body[data-ui-theme="clean-kelly"] .mobile-footer-nav button { color: var(--ck-muted); }
body[data-ui-theme="clean-kelly"] .mobile-footer-nav :is(button.active, button[aria-current="page"]) {
  background: var(--ck-action);
  color: var(--ck-canvas);
}
body[data-ui-theme="clean-kelly"] .mobile-footer-nav :is(button.active, button[aria-current="page"]) span { color: inherit; }

/* Shared typography and form treatment without changing global font metrics. */
body[data-ui-theme="clean-kelly"] :is(#collectorHome, #inventoryPage, #playerResearchPage, #cardDetail) :is(h1, h2, h3) {
  color: var(--ck-text);
  font-weight: 600;
  text-shadow: none;
}
body[data-ui-theme="clean-kelly"] :is(#inventoryPage, #playerResearchPage) :is(input, select, textarea) {
  background: var(--ck-surface);
  border-color: var(--ck-border);
  border-radius: 8px;
  color: var(--ck-text);
}
body[data-ui-theme="clean-kelly"] :is(.sidebar, #collectorHome, #inventoryPage, #playerResearchPage, #cardDetail, .mobile-footer-nav) :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--ck-anchor);
  outline-offset: 3px;
}

/* Beta Home: quiet dashboard surfaces with a clear primary scan action. */
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-dashboard, .beta-scan-panel, .beta-home-market, .beta-home-recent, .beta-home-inventory-master) {
  background: var(--ck-canvas);
  border: 1px solid var(--ck-border);
  border-radius: 12px;
  color: var(--ck-text);
  box-shadow: var(--ck-shadow);
}
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-dashboard::before,
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-dashboard::after {
  content: none;
}
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-dashboard { padding: 20px; }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-dashboard > header h2 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: -.025em;
}
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-dashboard > header > span, .beta-home-portfolio > span, .beta-home-pulse > strong, .beta-home-peer small, .beta-home-rail-heading > span) {
  color: var(--ck-muted);
  text-shadow: none;
}
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-portfolio > b {
  color: var(--ck-text);
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-portfolio > em { color: var(--ck-muted); font-weight: 500; }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-portfolio > em.positive { color: var(--ck-hover); }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-portfolio > em.negative { color: var(--red); }
body[data-ui-theme="clean-kelly"] #collectorHome #toggleHomePortfolio {
  background: var(--ck-surface);
  color: var(--ck-text);
  border: 1px solid var(--ck-border);
  border-radius: var(--radius-md);
  font-weight: 500;
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-peer, .beta-home-ask) {
  background: var(--ck-surface);
  border-color: var(--ck-border);
  border-radius: 10px;
  box-shadow: none;
  color: var(--ck-text);
}
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-peer-title, .beta-home-rail-heading strong, .beta-home-pulse, .beta-home-pulse p, .beta-home-ask input) { color: var(--ck-text); }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-ask input::placeholder { color: var(--ck-muted); opacity: 1; }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-pulse-empty { color: var(--ck-muted); font-size: .875rem; line-height: 1.5; }
body[data-ui-theme="clean-kelly"] #collectorHome #betaHomePulse button { background: transparent; color: var(--ck-text); }
body[data-ui-theme="clean-kelly"] #collectorHome #betaHomePulse button span { color: var(--ck-text); }
body[data-ui-theme="clean-kelly"] #collectorHome #betaHomePulse button strong { color: var(--ck-text); text-shadow: none; }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-ask button { background: var(--ck-action); color: #fff; box-shadow: none; }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-ask button:hover { background: var(--ck-hover); }
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-portfolio > span, .beta-home-pulse > strong, #betaHomePulse button span) { font-weight: 500; }
body[data-ui-theme="clean-kelly"] #collectorHome #betaHomePulse button strong { font-weight: 600; }
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-market-pick, .beta-home-recent-card) {
  background: var(--ck-canvas);
  color: var(--ck-text);
  border-color: var(--ck-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--ck-shadow);
}
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-market-image, .beta-home-recent-image) { background: var(--ck-surface); color: var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-recent-card em, .beta-home-market-pick dd, .beta-home-market-pick > div > strong) { color: var(--ck-text); font-weight: 600; }
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-recent-card small, .beta-home-market-pick dt, .beta-home-market-pick > div > span, .beta-home-recent > header > button) { color: var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-market-pick dd.up { color: var(--ck-hover); }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-market-pick dd.down { color: var(--red); }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-market-actions button { background: var(--ck-canvas); color: var(--ck-text); border-color: var(--ck-border); }
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-market-actions button:last-child, .beta-home-market-empty button) { background: var(--ck-action); border-color: var(--ck-action); color: var(--ck-canvas); }
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-market-actions button:last-child, .beta-home-market-empty button):hover { background: var(--ck-hover); }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-scan-actions > button {
  background: var(--ck-canvas);
  border-color: var(--ck-border);
  border-radius: 9px;
  box-shadow: none;
  color: var(--ck-text);
  min-height: 72px;
}
body[data-ui-theme="clean-kelly"] #collectorHome .beta-scan-actions > button:hover {
  border-color: var(--ck-hover);
  background: var(--ck-wash);
}
body[data-ui-theme="clean-kelly"] #collectorHome .beta-scan-actions > button strong { color: var(--ck-text); font-weight: 600; }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-scan-actions > button small { color: var(--ck-muted); font-weight: 400; line-height: 1.4; }
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-peer-icon, .beta-scan-action-icon) {
  background: var(--ck-wash);
  color: var(--ck-anchor);
  border-color: var(--ck-border);
  box-shadow: none;
}

/* White labels on the restored navy action fill meet AA text contrast. */
body[data-ui-theme="clean-kelly"] :is(#homeScanInventory, #betaHomeFloatingScan, #openInventoryActions) {
  background: var(--ck-action) !important;
  color: var(--ck-canvas) !important;
  border-color: var(--ck-action) !important;
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] :is(#homeScanInventory, #betaHomeFloatingScan, #openInventoryActions):hover {
  background: var(--ck-hover) !important;
  border-color: var(--ck-hover) !important;
}
body[data-ui-theme="clean-kelly"] #collectorHome #homeScanInventory :is(strong, small) { color: var(--ck-canvas); }
body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-peer-title { font-weight: 600; }

/* Approved soft-paper Home finish: a static tiled grain, never an overlay on
   text/photos. Keep the existing layout, click targets and sticky owners. */
body[data-ui-theme="clean-kelly"] #collectorHome {
  --ck-paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' seed='19' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.055' filter='url(%23grain)'/%3E%3C/svg%3E");
  background-color: var(--ck-surface);
  background-image: var(--ck-paper-grain);
}
body[data-ui-theme="clean-kelly"].beta-mode:has(#showPage.active) main {
  background-color: var(--ck-surface);
}
body[data-ui-theme="clean-kelly"] #collectorHome :is(.beta-home-dashboard, .beta-scan-panel, .beta-home-market, .beta-home-recent, .beta-home-inventory-master) {
  box-shadow: 0 3px 12px rgb(4 45 75 / 5%), 0 1px 2px rgb(4 45 75 / 3%), inset 0 1px 0 #fff;
}
body[data-ui-theme="clean-kelly"] #collectorHome #homeScanInventory {
  background-image: var(--ck-paper-grain), linear-gradient(130deg, rgb(255 255 255 / 3%), transparent 65%) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 2px 5px rgb(4 45 75 / 8%);
}
@media (prefers-contrast: more), (forced-colors: active) {
  body[data-ui-theme="clean-kelly"] #collectorHome,
  body[data-ui-theme="clean-kelly"] #collectorHome #homeScanInventory { background-image: none !important; }
}

/* Inventory: preserve all three layouts, default selectors and photo treatment. */
body[data-ui-theme="clean-kelly"] #inventoryPage :is(.panel, .inventory-bulk-actions, .inventory-pagination) {
  background: var(--ck-canvas);
  border-color: var(--ck-border);
  border-radius: 10px;
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #inventoryPage .compact-header h1 { font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -.025em; }
body[data-ui-theme="clean-kelly"] #inventoryPage :is(.secondary, .view-toggle button, .inventory-search-mode button, .inventory-pagination button) {
  background: var(--ck-canvas);
  color: var(--ck-text);
  border: 1px solid var(--ck-border);
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
}
body[data-ui-theme="clean-kelly"] #inventoryPage :is(.view-toggle button.active, .inventory-search-mode button.active, .inventory-pagination button[aria-current="page"]) {
  background: var(--ck-action);
  color: var(--ck-canvas);
  border-color: var(--ck-action);
}
body[data-ui-theme="clean-kelly"] #inventoryPage th { background: var(--ck-surface); color: var(--ck-muted); font-weight: 500; font-size: .75rem; letter-spacing: .05em; padding: 1rem 1.5rem; }
body[data-ui-theme="clean-kelly"] #inventoryPage td { padding: 1rem 1.5rem; }
body[data-ui-theme="clean-kelly"] #inventoryPage .table-shell { background: var(--ck-canvas); border-color: var(--ck-border); border-radius: var(--radius-lg); box-shadow: var(--ck-shadow); }
body[data-ui-theme="clean-kelly"] #inventoryPage :is(th, td) { border-color: var(--ck-border); }
body[data-ui-theme="clean-kelly"] #inventoryPage tbody tr:hover td { background: var(--ck-wash); }
body[data-ui-theme="clean-kelly"] #inventoryPage .results-heading { color: var(--ck-muted); }

/* CPI and its layers: white profile and KPI-style outlook, light panels.
   Specificity intentionally follows the existing CPI scope. No position, inset,
   overflow, image dimensions or visibility overrides are introduced here. */
body[data-ui-theme="clean-kelly"] #playerResearchPage,
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled {
  background: var(--ck-canvas);
  color: var(--ck-text);
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #playerResearchPage .player-research-modal-sheet { background: var(--ck-canvas); border-color: var(--ck-border); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled #playerResearchName {
  color: var(--ck-text) !important;
  font-size: clamp(1.5rem, 3.3vw, 2.6rem) !important;
  font-weight: 600;
  line-height: 1.15;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-overview-outlook { color: var(--ck-text); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-overview-outlook.is-loading { color: var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-development-summary, .player-profile-card-image) {
  background: var(--ck-surface);
  border-color: var(--ck-border);
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-profile-hero {
  background: var(--ck-canvas);
  color: var(--ck-text);
  border-color: var(--ck-border);
  border-radius: 12px;
  box-shadow: var(--ck-shadow);
  outline: none;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-profile-hero::before,
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-profile-hero::after,
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-cardiq-overview::before,
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-cardiq-overview::after { content: none; }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-profile-headline {
  background: var(--ck-wash);
  color: var(--ck-anchor) !important;
  border-radius: 0 0 8px 8px;
  font-weight: 600 !important;
  letter-spacing: .05em !important;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-profile-identity h1, .player-profile-position, .player-profile-meta, .player-layer-title h2) {
  color: var(--ck-text);
  text-shadow: none;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-watch-toggle, .player-watchlist-link) {
  background: var(--ck-wash);
  color: var(--ck-anchor);
  border-color: var(--ck-border);
  box-shadow: none;
  font-weight: 500;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-cardiq-overview {
  background: var(--ck-canvas);
  color: var(--ck-text);
  border-color: var(--ck-border);
  border-radius: 12px;
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-cardiq-overview :is(h2, h3, strong, p) { color: var(--ck-text); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-cardiq-overview :is(small, span) { color: var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-cardiq-overview > aside strong { color: var(--ck-text); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .player-cardiq-overview .collector-market-signal { background: var(--ck-wash); color: var(--ck-text); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled .collector-market-signal :is(strong, small, p) { color: var(--ck-anchor); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-panel, .player-layer-section, .player-research-section, .player-layer-stat-card, .player-profile-facts, .player-journey-snapshot, .player-career-snapshot) {
  background: var(--ck-canvas);
  color: var(--ck-text);
  border-color: var(--ck-border);
  border-radius: 10px;
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-section, .player-research-section) > summary {
  background: var(--ck-surface);
  color: var(--ck-text);
  border-color: var(--ck-border);
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-section, .player-research-section) > summary small { color: var(--ck-anchor); font-weight: 600; }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-career-snapshot, .player-journey-details) > summary { background: var(--ck-surface); border-color: var(--ck-border); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-career-snapshot, .player-journey-details) > summary :is(small, strong, b) { color: var(--ck-anchor); }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-nav, .player-layer-footer-nav, .player-layer-full-footer) {
  background: var(--ck-canvas);
  border-color: var(--ck-border);
  border-radius: 10px;
  box-shadow: 0 -2px 12px rgb(15 23 42 / 5%);
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-nav, .player-layer-footer-nav, .player-layer-full-footer) button {
  background: var(--ck-canvas);
  color: var(--ck-text);
  border: 1px solid var(--ck-border);
  border-radius: 8px;
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-nav, .player-layer-footer-nav, .player-layer-full-footer) button > span {
  background: var(--ck-wash);
  color: var(--ck-anchor);
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-nav, .player-layer-footer-nav, .player-layer-full-footer) button > strong { color: var(--ck-text); font-weight: 600; }
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-nav, .player-layer-footer-nav, .player-layer-full-footer) button[aria-current="page"] {
  background: var(--ck-action);
  border-color: var(--ck-action);
}
body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-nav, .player-layer-footer-nav, .player-layer-full-footer) button[aria-current="page"] > strong { color: var(--ck-canvas); }

/* Card drawers: preserve the approved compact image and exact/reference cues. */
body[data-ui-theme="clean-kelly"] #cardDetail,
body[data-ui-theme="clean-kelly"] #cardDetail .detail-shell {
  background: var(--ck-canvas);
  border-color: var(--ck-border);
  color: var(--ck-text);
}
body[data-ui-theme="clean-kelly"] #cardDetail :is(.inventory-lifecycle, .card-facts-groups, .drawer-player-summary) {
  background: var(--ck-surface);
  border-color: var(--ck-border);
  color: var(--ck-text);
  box-shadow: none;
}
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.full-card-identity h2, .drawer-player-name) { color: var(--ck-text); }
/* The light snapshot surface must also override the legacy white paragraph. */
body[data-ui-theme="clean-kelly"] #cardDetail .drawer-player-summary > p { color: var(--ck-text); }

/* Finish drawer token coverage without changing semantic status dots or eBay branding. */
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open { color: var(--ck-text); }
body[data-ui-theme="clean-kelly"] #cardDetail :is(.drawer-player-facts, .market-guide-view>header, .market-exact-panel, .market-disclosure, .market-history-empty, .market-reference-pending, .drawer-sample-evidence) { background:var(--ck-surface);border-color:var(--ck-border);color:var(--ck-text); }
body[data-ui-theme="clean-kelly"] #cardDetail :is(.player-summary-row>span, .player-summary-row-bottom, .market-exact-listings) { border-color:var(--ck-border); }
body[data-ui-theme="clean-kelly"] #cardDetail :is(.drawer-player-facts small, .drawer-outlook-toggle, .market-history-symbol) { color:var(--ck-action); }
body[data-ui-theme="clean-kelly"] #cardDetail :is(.drawer-player-facts strong, .investment-metrics strong, .market-history-empty strong, .market-disclosure>summary) { color:var(--ck-text); }
body[data-ui-theme="clean-kelly"] #cardDetail :is(.card-heading-primary>small, .card-heading-secondary>p, .full-card-chips, .investment-metrics span, .market-family-label, .market-section-title>span, .market-disclosure>summary>small) { color:var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #cardDetail .full-card-chips span { background:var(--ck-wash);border-color:var(--ck-border);color:var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.hero-player-snapshot>summary, .market-section-title h2) { font-family:var(--font-family);font-size:.5625rem;font-weight:600;line-height:1.2;letter-spacing:.04em;color:var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #cardDetail .inventory-lifecycle .detail-inline-action { background:var(--ck-action);border-color:var(--ck-action);color:var(--ck-canvas);box-shadow:none; }
body[data-ui-theme="clean-kelly"] #cardDetail .inventory-lifecycle .detail-inline-action:hover { background:var(--ck-hover);border-color:var(--ck-hover);color:var(--ck-canvas); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-guide-view { background:var(--ck-surface);border-color:var(--ck-border);color:var(--ck-text); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-condition-controls { background:var(--ck-wash); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-condition-controls button { color:var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-condition-controls button[aria-pressed=true] { background:var(--ck-canvas);color:var(--ck-action); }
body[data-ui-theme="clean-kelly"] #cardDetail :is(.market-quote-label,.market-guide-caption,.market-guide-empty,.drawer-reference-empty,.market-grade-grid span) { color:var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-guide-more { border-color:var(--ck-border); }

/* Final drawer hierarchy: same visual treatment for the same content role. */
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.hero-player-snapshot>summary, .mobile-facts-toggle, .market-section-title h2, .inventory-lifecycle>header h3, .card-actions>.eyebrow, .collection-plan-section>summary>span, .drawer-next-rail>header .eyebrow, .market-guide-view>header small) {
  font-size:.5625rem;font-weight:600;line-height:1.3;letter-spacing:.04em;color:var(--ck-muted);
}
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .card-facts-group h4 { font-size:.5625rem;font-weight:600;line-height:1.3;letter-spacing:.04em;color:var(--ck-action); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.card-fact-row dt, .investment-metrics span) { font-size:.625rem;font-weight:500;line-height:1.4;letter-spacing:0;color:var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .card-fact-row dd { font-size:.68rem;font-weight:600;line-height:1.4;color:var(--ck-text); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .card-fact-row dd.not-recorded { font-weight:400;color:var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.market-guide-body h3, .market-reference-pending strong, .drawer-retained-summary h3, .card-ebay-state strong) { font-size:.75rem!important;font-weight:600;line-height:1.4;color:var(--ck-text); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.market-disclosure>summary, .market-disclosure-body p, .drawer-player-summary>p, .market-guide-empty, .market-reference-pending p) { font-size:.75rem;line-height:1.45; }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.market-disclosure>summary>small, .market-section-title>span, .card-ebay-state small, .collection-plan-section>summary>em) { font-size:.65rem;font-weight:400;line-height:1.4;color:var(--ck-muted); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .inventory-lifecycle.is-listed { background:var(--ck-canvas); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.card-actions, .collection-plan-section, .drawer-next-rail>div>button) { background:var(--ck-surface);border-color:var(--ck-border);border-radius:12px;box-shadow:none; }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .card-actions button { background:transparent;border-color:var(--ck-border);color:var(--ck-action);box-shadow:none;font-size:.75rem;font-weight:600;line-height:1.4; }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .card-actions button>span { font-size:.75rem;font-weight:600;line-height:1.4; }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.card-actions button>b, .drawer-next-rail button>b) { background:var(--ck-wash);color:var(--ck-action); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .drawer-disclosure>summary::after { background:var(--ck-wash);color:var(--ck-action); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.card-actions button:hover, .collection-plan-grid button:hover) { background:var(--ck-wash);color:var(--ck-hover); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.card-actions button:focus-visible, .collection-plan-grid button:focus-visible) { outline:2px solid var(--ck-action);outline-offset:-2px; }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .collection-plan-grid button { background:var(--ck-canvas);border-color:var(--ck-border);color:var(--ck-action);font-size:.75rem;font-weight:600; }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open .collection-plan-grid button.active { background:var(--ck-wash);border-color:var(--ck-action);box-shadow:inset 0 0 0 1px var(--ck-action); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.drawer-next-rail button strong, .drawer-next-rail button em) { font-size:.75rem;font-weight:600;color:var(--ck-text); }
body[data-ui-theme="clean-kelly"] #cardDetail .market-layout.full-card-open :is(.drawer-next-rail button small, .drawer-next-rail>header>span) { font-size:.65rem;font-weight:400;color:var(--ck-muted); }

@media (max-width: 760px) {
  body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled #playerResearchName { font-size: clamp(1.35rem, 6vw, 1.8rem) !important; }
  body[data-ui-theme="clean-kelly"] #playerResearchContent.cardiq-profile-enabled :is(.player-layer-nav, .player-layer-footer-nav, .player-layer-full-footer) button > strong { font-size: .75rem; line-height: 1.3; letter-spacing: -.02em; }
  body[data-ui-theme="clean-kelly"] #collectorHome .beta-home-dashboard { padding: 16px; }
  body[data-ui-theme="clean-kelly"] #collectorHome .beta-scan-actions > button { min-height: 80px; }
  body[data-ui-theme="clean-kelly"] #collectorHome .beta-scan-actions > button strong { font-size: 1rem; line-height: 1.25; }
  body[data-ui-theme="clean-kelly"] #collectorHome .beta-scan-actions > button small { font-size: .875rem; }
  body[data-ui-theme="clean-kelly"] :is(#inventoryPage, #playerResearchPage) :is(input, select, textarea) { font-size: 1rem; min-height: 44px; }
  body[data-ui-theme="clean-kelly"] #inventoryPage :is(.view-toggle button, .inventory-pagination button) { min-height: 44px; min-width: 44px; }
}
