/* Illustration theme. UI only; resource image dimensions stay in the base stylesheet. */
html:root body.illustration-ui {
  --bg:#edf0f7; --surface:rgba(255,255,255,.89); --soft:rgba(235,239,249,.86);
  --text:#333c55; --muted:#69768e; --rule:rgba(112,131,165,.2); --border:rgba(112,131,165,.26);
  --primary:#677eae; --primary-light:#9baed0; --primary-dark:#445c89;
  --button:#647cab; --button-text:#fff; --card:var(--surface);
  --accent:#657eae; --accent-soft:rgba(115,139,185,.14);
  --glass:rgba(249,251,255,.86); --shadow:0 8px 28px rgba(58,74,112,.09);
  --panel-shadow:0 18px 60px rgba(37,49,80,.16); --wall-veil:rgba(234,240,251,.50);
  background:var(--bg)!important; color:var(--text)!important;
}
html:root[data-theme="dark"] body.illustration-ui {
  --bg:#202639; --surface:rgba(36,44,64,.94); --soft:rgba(49,60,84,.92);
  --text:#e1e8f7; --muted:#b0bed4; --rule:rgba(164,184,217,.18); --border:rgba(164,184,217,.24);
  --primary:#a9bedf; --primary-light:#788eaf; --primary-dark:#c8d8f2;
  --button:#8da8d4; --button-text:#15243d; --card:var(--surface);
  --accent:#aec5eb; --accent-soft:rgba(158,188,234,.14);
  --glass:rgba(27,35,53,.9); --shadow:0 8px 28px rgba(5,10,26,.19);
  --panel-shadow:0 18px 60px rgba(0,0,0,.3); --wall-veil:rgba(17,25,44,.72);
}
html:root body.illustration-ui #illustrationBackdrop{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;background:linear-gradient(135deg,#e9e9f5,#e9f2f5 55%,#f5e9ef)}
html:root body.illustration-ui #illustrationBackdrop img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 38%;opacity:0;transition:opacity 1.8s ease;user-select:none}
html:root body.illustration-ui #illustrationBackdrop img.is-visible{opacity:1}
html:root body.illustration-ui #illustrationBackdrop::after{content:"";position:absolute;inset:0;background:var(--wall-veil);transition:background .35s}
html:root body.illustration-ui #bg-layer{display:none!important}
html:root body.illustration-ui #mainScroll{position:relative;z-index:1;background:transparent!important;scrollbar-color:var(--primary-light) transparent;scrollbar-width:thin}
html:root body.illustration-ui button,html:root body.illustration-ui a{touch-action:manipulation}
html:root body.illustration-ui :is(button,a,input,textarea,select,[role="button"]):focus-visible{outline:3px solid var(--primary-light)!important;outline-offset:3px!important}
html:root body.illustration-ui ::selection{background:#b7c9e9;color:#223554}

/* Navigation, search and the permanent desktop rail. */
html:root body.illustration-ui > header{background:var(--glass)!important;border:1px solid var(--rule)!important;box-shadow:var(--shadow)!important;backdrop-filter:blur(16px)!important;-webkit-backdrop-filter:blur(16px)!important}
html:root body.illustration-ui .px-title-bar{background:transparent!important;border:0!important;box-shadow:none!important}
html:root body.illustration-ui .px-title-text,html:root body.illustration-ui .sidebar-title{color:var(--text)!important;letter-spacing:1px!important;font-weight:800!important}
html:root body.illustration-ui :is(.header-icon-btn,.sidebar-burger){border:1px solid var(--rule)!important;background:var(--surface)!important;color:var(--text)!important;box-shadow:0 3px 9px rgba(67,83,123,.04)!important;border-radius:12px!important;transition:background .2s,transform .2s!important}
html:root body.illustration-ui .header-icon-btn:hover{background:var(--accent-soft)!important}
html:root body.illustration-ui .search-row{border:1px solid var(--border)!important;border-radius:16px!important;background:var(--surface)!important;box-shadow:0 2px 8px rgba(71,91,132,.04)!important;padding:5px!important;min-height:48px!important}
html:root body.illustration-ui .search-row:focus-within{border-color:var(--primary)!important;box-shadow:0 0 0 4px var(--accent-soft)!important}
html:root body.illustration-ui .search-row #search{background:transparent!important;color:var(--text)!important;border:0!important;padding-left:14px!important}
html:root body.illustration-ui #search::placeholder{color:var(--muted)!important;opacity:.85!important}
html:root body.illustration-ui .search-row #filterBtn{background:var(--accent-soft)!important;color:var(--primary-dark)!important;border:0!important;border-radius:11px!important;box-shadow:none!important;padding:9px 18px!important}
html:root body.illustration-ui .search-row #filterBtn.active{background:var(--button)!important;color:var(--button-text)!important}
html:root body.illustration-ui #sidebar{background:var(--glass)!important;border:1px solid var(--rule)!important;box-shadow:var(--shadow)!important;backdrop-filter:blur(18px)!important;-webkit-backdrop-filter:blur(18px)!important}
html:root body.illustration-ui .sidebar-header{background:transparent!important;border-bottom:1px solid var(--rule)!important;padding:28px 20px 22px!important;text-align:left!important}
html:root body.illustration-ui .sidebar-title{font-size:25px!important}
html:root body.illustration-ui .sidebar-subtitle{font-size:11px!important;color:var(--muted)!important;letter-spacing:2px!important;margin-top:8px!important}
html:root body.illustration-ui .sidebar-menu{padding:12px!important;scrollbar-width:thin;scrollbar-color:var(--primary-light) transparent}
html:root body.illustration-ui .sidebar-item{border:0!important;border-radius:12px!important;color:var(--muted)!important;padding:13px 12px!important;box-shadow:none!important;transition:background .2s,color .2s!important}
html:root body.illustration-ui .sidebar-item.active,html:root body.illustration-ui .sidebar-item:hover{background:var(--accent-soft)!important;color:var(--primary-dark)!important}
html:root body.illustration-ui .pc-cat-label{color:var(--muted)!important;font-size:11px!important;letter-spacing:2px!important;padding:8px 12px 12px!important}
html:root body.illustration-ui #nav li{border:1px solid transparent!important;border-radius:11px!important;background:transparent!important;box-shadow:none!important;color:var(--muted)!important;transition:background .2s,color .2s!important;font-weight:500!important}
html:root body.illustration-ui #nav li:hover{background:var(--accent-soft)!important;color:var(--text)!important}
html:root body.illustration-ui #nav li.active{background:var(--accent-soft)!important;border-color:var(--border)!important;color:var(--primary-dark)!important;font-weight:750!important}
html:root body.illustration-ui #nav .nav-count{font-size:11px!important;font-weight:500!important;opacity:.8!important;font-variant-numeric:tabular-nums}
html:root body.illustration-ui #filterTagsBar .filter-tag{background:var(--surface)!important;border:1px solid var(--border)!important;color:var(--text)!important}
html:root body.illustration-ui #bannerSection{width:100%!important;max-width:550px!important;margin:26px auto 14px!important;border:1px solid var(--border)!important;border-radius:22px!important;box-shadow:var(--shadow)!important;background:var(--glass)!important;overflow:hidden!important}
html:root body.illustration-ui #bannerSection .banner-caption{background:var(--glass)!important;color:var(--text)!important;text-shadow:none!important;border-top:1px solid var(--rule)!important}
html:root body.illustration-ui #bannerSection .banner-dots{background:transparent!important}
html:root body.illustration-ui .illustration-section-label{max-width:1240px;margin:0 auto;padding:13px 28px 15px;box-sizing:border-box;display:flex;gap:12px;align-items:center;color:var(--text);font-size:17px;font-weight:750;text-shadow:0 1px 8px var(--bg)}
html:root body.illustration-ui .illustration-section-label::before{content:"";height:18px;width:4px;border-radius:4px;background:var(--primary)}
html:root body.illustration-ui .illustration-section-label::after{content:"";height:1px;flex:1;background:var(--border);margin-left:6px}

/* Preserve the established 210x160 / 155x126 cover frames. */
html:root body.illustration-ui #box.grid{gap:18px!important;padding:0 26px 26px!important}
html:root body.illustration-ui #box .card.active-render:not(.card-expanded),html:root body.illustration-ui .fav-panel-grid .card:not(.card-expanded){border:1px solid var(--border)!important;border-radius:18px!important;background:var(--surface)!important;box-shadow:var(--shadow)!important;transition:transform .22s ease,box-shadow .22s ease,border-color .22s!important;padding:2px!important;box-sizing:border-box!important}
html:root body.illustration-ui #box .card.is-pinned:not(.card-expanded){border-color:var(--primary-light)!important}
html:root body.illustration-ui #box .card:not(.card-expanded) .card-thumb{border-radius:15px 4px 4px 15px!important;overflow:hidden!important}
html:root body.illustration-ui .card:not(.card-expanded) .card-preview{background:transparent!important;padding:13px 14px!important}
html:root body.illustration-ui .card:not(.card-expanded) .card-preview-title{color:var(--text)!important;text-shadow:none!important;font-weight:700!important;line-height:1.55!important}
html:root body.illustration-ui .card.is-pinned .card-preview-title::before{color:var(--primary-dark)!important;background:var(--accent-soft)!important;border:0!important;border-radius:5px!important;font-weight:500!important}
html:root body.illustration-ui .card:not(.card-expanded) .card-preview-tags .pt{background:var(--soft)!important;border:1px solid var(--rule)!important;color:var(--muted)!important;border-radius:5px!important;font-weight:400!important}
html:root body.illustration-ui :is(.card-date,.card-view-count,.card-preview-desc){color:var(--muted)!important;font-weight:400!important;text-shadow:none!important}
html:root body.illustration-ui .card-preview-bottom{gap:6px!important}
html:root body.illustration-ui .card-expand-hint{background:var(--accent-soft)!important;border:0!important;border-radius:7px!important;color:var(--primary-dark)!important;padding:5px 8px!important;font-weight:500!important;text-shadow:none!important}
html:root body.illustration-ui .resource-size-badge{border:1px solid var(--rule)!important;border-radius:8px!important;box-shadow:none!important}
html:root body.illustration-ui #pagination{gap:8px!important;padding-bottom:28px!important}
html:root body.illustration-ui #pagination button,html:root body.illustration-ui .page-btn{border:1px solid var(--rule)!important;background:var(--surface)!important;color:var(--text)!important;box-shadow:var(--shadow)!important;border-radius:10px!important}
html:root body.illustration-ui #pagination .active{background:var(--button)!important;color:var(--button-text)!important;border-color:transparent!important}
@media (hover:hover){html:root body.illustration-ui #box .card.active-render:not(.card-expanded):hover{transform:translateY(-3px)!important;box-shadow:0 14px 32px rgba(48,71,112,.17)!important;border-color:var(--primary-light)!important}}
html:root body.illustration-ui #box .card.active-render:not(.card-expanded):active{transform:translateY(0)!important}
@keyframes illustrationAppear{from{opacity:.35}to{opacity:1}}
html:root body.illustration-ui #box .card.active-render:not(.card-expanded){animation:illustrationAppear .4s ease both!important}

/* Details, comments, sign-in and tool dialogs use the same material. */
html:root body.illustration-ui :is(#cardDetailPage,.fullpage-panel){background:var(--glass)!important;background-image:none!important}
html:root body.illustration-ui :is(#detailBgLayer,#galleryBgLayer,#txnavBgLayer){background:transparent!important;background-image:none!important}
html:root body.illustration-ui :is(#cardDetailHeader,.fullpage-header){background:var(--glass)!important;border-bottom:1px solid var(--border)!important;box-shadow:0 3px 18px rgba(46,65,100,.06)!important;backdrop-filter:blur(14px)!important;-webkit-backdrop-filter:blur(14px)!important}
html:root body.illustration-ui :is(.detail-gallery-wrap,.quiet-detail-meta,#cardDetailBody>.detail-glass,#cardDetailBody>.comment-section,.notice-content-wrap,.txnav-card){border:1px solid var(--border)!important;border-radius:20px!important;background:var(--surface)!important;box-shadow:var(--shadow)!important}
html:root body.illustration-ui .quiet-detail-meta{padding:22px!important;margin-top:18px!important}
html:root body.illustration-ui :is(.detail-title-gradient,.detail-date,.detail-desc-text){color:var(--text)!important;background:transparent!important;text-shadow:none!important}
html:root body.illustration-ui .detail-date{color:var(--muted)!important}
html:root body.illustration-ui :is(.detail-tag-chip,.resource-work-detail .resource-official-link){border:1px solid var(--rule)!important;background:var(--accent-soft)!important;color:var(--primary-dark)!important;box-shadow:none!important}
html:root body.illustration-ui .resource-work-detail{color:var(--muted)!important}
html:root body.illustration-ui :is(#cardDetailBackBtn,#cardDetailFavBtn,.fullpage-back-btn,.detail-glass-btn){border:1px solid var(--border)!important;border-radius:11px!important;background:var(--surface)!important;color:var(--text)!important;box-shadow:none!important}
html:root body.illustration-ui :is(.modal-box,.user-modal-box,.filter-box,#turnstileBox,.cat-panel,.banner-edit-panel){border:1px solid var(--border)!important;border-radius:23px!important;background:var(--surface)!important;color:var(--text)!important;box-shadow:var(--panel-shadow)!important}
html:root body.illustration-ui :is(.user-field input,.filter-input-row input,.comment-input,.reply-input,.txnav-input){border:1px solid var(--border)!important;border-radius:11px!important;background:var(--soft)!important;color:var(--text)!important;box-shadow:none!important}
html:root body.illustration-ui :is(.user-tab-btn,.modal-btn,.user-submit-btn,.filter-close-btn,.cat-add-btn,.notice-save-btn,.comment-submit-btn,.txnav-btn-sm,.banner-save-btn){border-radius:11px!important;box-shadow:none!important;border-width:1px!important}
html:root body.illustration-ui :is(.modal-title,.user-modal-title,.filter-title,.comment-header,.comment-section-title){color:var(--text)!important}
html:root body.illustration-ui :is(.modal-btn.btn-cancel,.user-tab-btn:not(.active),.filter-close-btn){background:var(--soft)!important;color:var(--text)!important;border-color:var(--border)!important}
html:root body.illustration-ui :is(.comment-item,.comment-reply,.reply-item){border-color:var(--rule)!important;background:transparent!important;box-shadow:none!important}
html:root body.illustration-ui :is(.comment-content,.comment-content-text){color:var(--text)!important}
html:root body.illustration-ui :is(.comment-time,.comment-meta,.comment-sort-btn){color:var(--muted)!important}
html:root body.illustration-ui :is(.comment-action-btn,.comment-sort-btn,.comment-like-btn){border:1px solid var(--rule)!important;background:var(--soft)!important;border-radius:8px!important;box-shadow:none!important}
html:root body.illustration-ui :is(#adminBarBtns button,.admin-toggle-btn,.admin-resource-edit-btn){border:1px solid var(--border)!important;border-radius:10px!important;box-shadow:none!important}
html:root body.illustration-ui #adminBar{border-color:var(--rule)!important;background:var(--glass)!important;border-radius:16px!important}
html:root body.illustration-ui #resourceEditorHost{background:var(--bg)!important}
html:root body.illustration-ui :is(#globalLoadingOverlay,#contentBlocker,#detailLoading){background:var(--bg)!important}
html:root body.illustration-ui #globalLoadingOverlay .load-text{color:var(--text)!important;letter-spacing:2px}
html:root body.illustration-ui #globalLoadingOverlay .load-sub{color:var(--muted)!important}
html:root body.illustration-ui #gateKeeper{background:var(--bg)!important;background-image:none!important}
html:root body.illustration-ui .gate-box{max-width:720px!important;margin:24px auto!important;width:calc(100% - 32px)!important;height:calc(100% - 48px)!important;background:var(--surface)!important;border:1px solid var(--border)!important;border-radius:24px!important;box-shadow:var(--panel-shadow)!important}
html:root body.illustration-ui .gate-bottom{background:var(--glass)!important;border-top:1px solid var(--rule)!important}
html:root body.illustration-ui .disclaimer{border:1px solid var(--border)!important;background:var(--soft)!important;border-radius:14px!important;color:var(--text)!important}
html:root body.illustration-ui #slideUnlock{border:1px solid var(--border)!important;border-radius:14px!important;background:var(--soft)!important;box-shadow:none!important}

@media(min-width:1024px){
  html:root body.illustration-ui #sidebar{left:18px!important;top:18px!important;bottom:18px!important;width:224px!important;height:calc(100% - 36px)!important;border-radius:24px!important;overflow:hidden!important}
  html:root body.illustration-ui > header{margin:18px 22px 0 262px!important;border-radius:20px!important;padding:14px 20px!important;min-height:76px!important;box-sizing:border-box!important}
  html:root body.illustration-ui #mainScroll{margin-left:242px!important}
  html:root body.illustration-ui > header .search-row{margin-left:0!important;max-width:calc(100% - 170px)!important}
  html:root body.illustration-ui > header .px-title-bar{right:20px!important;top:21px!important}
  html:root body.illustration-ui #nav{gap:3px!important;padding:0!important;margin-bottom:18px!important}
  html:root body.illustration-ui #nav li{padding:10px 12px!important;min-height:39px!important}
}
@media(min-width:1024px) and (max-width:1279px){
  html:root body.illustration-ui #box.grid{grid-template-columns:1fr!important;max-width:820px!important}
}
@media(max-width:1023px){
  html:root body.illustration-ui > header{border:0!important;border-bottom:1px solid var(--border)!important;padding:12px 14px 8px!important}
  html:root body.illustration-ui .px-title-bar{padding:3px 0 14px!important}
  html:root body.illustration-ui .px-title-text{font-size:23px!important}
  html:root body.illustration-ui :is(.header-icon-btn,.sidebar-burger){width:34px!important;height:34px!important;border-radius:10px!important}
  html:root body.illustration-ui #nav{gap:7px!important;padding:12px 0 4px!important}
  html:root body.illustration-ui #nav li{padding:8px 13px!important;background:var(--surface)!important;border-color:var(--rule)!important;font-size:13px!important}
  html:root body.illustration-ui #nav li.active{background:var(--accent-soft)!important}
  html:root body.illustration-ui #sidebar{border-radius:0 24px 24px 0!important}
  html:root body.illustration-ui #bannerSection{border-radius:18px!important}
  html:root body.illustration-ui .illustration-section-label{padding:12px 18px;max-width:760px;font-size:15px}
  html:root body.illustration-ui #box.grid{gap:12px!important;padding:0 14px 20px!important}
  html:root body.illustration-ui #box .card.active-render:not(.card-expanded){border-radius:16px!important}
  html:root body.illustration-ui #box .card:not(.card-expanded) .card-thumb{border-radius:13px 4px 4px 13px!important}
  html:root body.illustration-ui .card:not(.card-expanded) .card-preview{padding:9px 10px!important}
  html:root body.illustration-ui .card-preview-bottom{gap:4px!important}
  html:root body.illustration-ui .card-expand-hint{font-size:10px!important;padding:4px 6px!important}
  html:root body.illustration-ui .quiet-detail-meta{padding:16px!important}
  html:root body.illustration-ui .gate-box{margin:12px auto!important;height:calc(100% - 24px)!important}
}
@media(prefers-reduced-motion:reduce){html:root body.illustration-ui *,html:root body.illustration-ui *::before,html:root body.illustration-ui *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

@media(max-width:1023px){html:root body.illustration-ui #bannerSection{margin:16px auto 6px!important}}
