/**
 * HEADER RECENTS DISPLAY LOCK — load LAST on every AI tool page.
 *
 * PERMANENT FIX (2026-06-24): Viewport-dependent CSS nth-child caps made the SAME
 * account show DIFFERENT header thumbnails in Cursor vs Opera (different innerWidth).
 * Newest images are appended as LAST child — nth-child(n+N) display:none hid them.
 *
 * RULE: JS limits how many items are rendered; header strips scroll horizontally.
 * DO NOT add display:none nth-child caps on .main-header recents strips in any CSS file.
 *
 * Verify: npm run test:locks → CRITICAL HEADER RECENTS DISPLAY LOCK
 * See RECURRING_BUGS.md → "Header recents display lock (permanent)"
 */

/* Scrollable header strips — newest on the right */
body.sketch-page .main-header .hdr-editor-title-lane #sketch-recents-strip.sketch-recents-strip,
body.quick-edit-page .main-header .hdr-editor-title-lane #qe-recents-strip.sketch-recents-strip,
body.magic-blend-page .main-header .hdr-editor-title-lane #sketch-recents-strip.sketch-recents-strip,
body.stencil-page .main-header .hdr-editor-title-lane #qe-recents-strip.sketch-recents-strip,
body.try-on-page .main-header .hdr-editor-title-lane #tryon-result-history.tryon-result-history,
body.talk-create-page .main-header .hdr-editor-title-lane #talk-create-recents-strip.sketch-recents-strip,
body.talk-create-page .main-header .hdr-editor-title-lane #talk-create-recents-strip.talk-create-recents-strip {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

body.sketch-page .main-header .hdr-editor-title-lane #sketch-recents-strip.sketch-recents-strip::-webkit-scrollbar,
body.quick-edit-page .main-header .hdr-editor-title-lane #qe-recents-strip.sketch-recents-strip::-webkit-scrollbar,
body.magic-blend-page .main-header .hdr-editor-title-lane #sketch-recents-strip.sketch-recents-strip::-webkit-scrollbar,
body.stencil-page .main-header .hdr-editor-title-lane #qe-recents-strip.sketch-recents-strip::-webkit-scrollbar,
body.try-on-page .main-header .hdr-editor-title-lane #tryon-result-history.tryon-result-history::-webkit-scrollbar,
body.talk-create-page .main-header .hdr-editor-title-lane #talk-create-recents-strip::-webkit-scrollbar {
    display: none;
}

/* Undo ALL legacy nth-child visibility caps inside main-header title lane (every breakpoint). */
body .main-header .hdr-editor-title-lane .sketch-recent-thumb:nth-child(n+5),
body .main-header .hdr-editor-title-lane .sketch-recent-thumb:nth-child(n+6),
body .main-header .hdr-editor-title-lane .sketch-recent-thumb:nth-child(n+11),
body .main-header .hdr-editor-title-lane .talk-create-recent-thumb:nth-child(n+11),
body .main-header .hdr-editor-title-lane .tryon-output-thumbnail:nth-child(n+5),
body .main-header .hdr-editor-title-lane .tryon-output-thumbnail:nth-child(n+6) {
    display: block !important;
}
