/* Fixed navigation and animated light/dark theme control */
html{scroll-padding-top:88px}
.site-shell{padding-top:68px}
.site-header{
  position:fixed;
  inset:0 0 auto;
  width:100%;
  isolation:isolate;
}

.theme-toggle{
  width:54px;
  height:34px;
  flex:0 0 54px;
  padding:0;
  border:0;
  border-radius:999px;
  background:transparent;
  cursor:pointer;
}
.theme-toggle-track{
  position:relative;
  width:100%;
  height:100%;
  display:block;
  overflow:hidden;
  border:1px solid #cbc7bd;
  border-radius:inherit;
  background:linear-gradient(135deg,#fff6cf,#f0eee7 62%);
  box-shadow:inset 0 1px 2px #fff,0 6px 16px rgba(45,39,31,.10);
  transition:background 420ms var(--ease-soft),border-color 320ms ease,box-shadow 420ms ease;
}
.theme-toggle-track:before,.theme-toggle-track:after{
  content:"";
  position:absolute;
  border-radius:50%;
  opacity:.7;
  transition:transform 520ms var(--ease-out),opacity 320ms ease;
}
.theme-toggle-track:before{width:4px;height:4px;right:9px;top:8px;background:#ffb84d;box-shadow:9px 7px 0 #ffc96b,2px 15px 0 #ffb84d}
.theme-toggle-track:after{width:3px;height:3px;left:8px;top:8px;background:#dce8ff;box-shadow:8px 13px 0 #dce8ff,2px 18px 0 #fff}
.theme-toggle-orb{
  position:absolute;
  left:4px;
  top:4px;
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:50%;
  color:#6e5500;
  background:linear-gradient(145deg,#d6ff71,#b9ed44);
  box-shadow:0 4px 10px rgba(74,85,25,.24);
  transform:translate3d(0,0,0) rotate(0deg);
  transition:transform 520ms var(--ease-out),background 420ms ease,color 320ms ease,box-shadow 420ms ease;
}
.theme-toggle .icon{position:absolute;width:15px;height:15px;transition:opacity 260ms ease,transform 520ms var(--ease-out)}
.theme-sun{opacity:1;transform:scale(1) rotate(0)}
.theme-moon{opacity:0;transform:scale(.55) rotate(-70deg)}
.theme-toggle:hover .theme-toggle-orb{box-shadow:0 6px 15px rgba(72,83,20,.34)}
.theme-toggle:focus-visible{outline:3px solid var(--light-lime-strong);outline-offset:3px}

html[data-theme="dark"]{
  --bg:#0b0c0f;
  --surface:#15171c;
  --surface2:#111318;
  --line:#303540;
  --text:#f7f8fb;
  --muted:#9b9fa8;
  --light-bg:#0b0c0f;
  --light-surface:#15171c;
  --light-soft:#111318;
  --light-soft-2:#1b1e24;
  --light-line:#303540;
  --light-ink:#f7f8fb;
  --light-muted:#9b9fa8;
  --light-accent-text:#c9f56a;
  background:#0b0c0f;
  color:#f7f8fb;
}
html[data-theme="dark"] .theme-toggle-track{border-color:#3c4350;background:linear-gradient(135deg,#151b2b,#0c0f16 70%);box-shadow:inset 0 1px 1px #ffffff12,0 7px 18px #0007}
html[data-theme="dark"] .theme-toggle-track:before{opacity:0;transform:translateX(-18px)}
html:not([data-theme="dark"]) .theme-toggle-track:after{opacity:0;transform:translateX(18px)}
html[data-theme="dark"] .theme-toggle-orb{color:#eef4ff;background:linear-gradient(145deg,#52627c,#263044);box-shadow:0 4px 12px #0009;transform:translate3d(20px,0,0) rotate(180deg)}
html[data-theme="dark"] .theme-sun{opacity:0;transform:scale(.55) rotate(90deg)}
html[data-theme="dark"] .theme-moon{opacity:1;transform:scale(1) rotate(-180deg)}

html[data-theme="dark"] body,
html[data-theme="dark"] .site-shell,
html[data-theme="dark"] .inner-page,
html[data-theme="dark"] .article-page{background:#0b0c0f;color:#f7f8fb}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .brand,
html[data-theme="dark"] .stats strong,
html[data-theme="dark"] .page-count strong{color:#f7f8fb}
html[data-theme="dark"] .site-header{border-color:#2f343d;background:rgba(9,10,13,.91);box-shadow:0 10px 34px #0006}
html[data-theme="dark"] .desktop-nav{color:#b5b7bf}
html[data-theme="dark"] .desktop-nav a:hover,
html[data-theme="dark"] .desktop-nav button:hover,
html[data-theme="dark"] .desktop-nav button.active{color:#fff}
html[data-theme="dark"] .desktop-nav button.active{background:#22252b}
html[data-theme="dark"] .desktop-nav button span{border-color:#3a404b;color:#c9f56a}
html[data-theme="dark"] .header-search{border-color:#30343d;background:#181b22}
html[data-theme="dark"] .header-search input{color:#eee}
html[data-theme="dark"] .header-search input::placeholder{color:#757a84}
html[data-theme="dark"] .primary-button,
html[data-theme="dark"] .hero-search button,
html[data-theme="dark"] .explore-head form button{border-color:#f2f2f3;background:#f2f2f3;color:#101115;box-shadow:0 12px 28px #0007}
html[data-theme="dark"] .primary-button .icon,
html[data-theme="dark"] .hero-search button .icon{filter:brightness(0)}

html[data-theme="dark"] .mega-menu{border-color:#343943;background:rgba(15,17,22,.985);box-shadow:0 28px 80px #000b}
html[data-theme="dark"] .mega-tasks,
html[data-theme="dark"] .mega-links{border-color:#303540}
html[data-theme="dark"] .mega-title,
html[data-theme="dark"] .mega-links>span{color:#7f8590}
html[data-theme="dark"] .mega-grid>a{border-color:#2b3038;background:#171a20}
html[data-theme="dark"] .mega-grid>a:hover{border-color:#555b66;background:#1d2027}
html[data-theme="dark"] .mega-grid b{background:#241c1c}
html[data-theme="dark"] .mega-grid small,
html[data-theme="dark"] .mega-links small{color:#777d88}

html[data-theme="dark"] .hero{border-color:#303540;background:radial-gradient(circle at 78% 30%,rgba(255,99,71,.13),transparent 38%),#0b0c0f}
html[data-theme="dark"] .hero-eyebrow,
html[data-theme="dark"] .hero-desc,
html[data-theme="dark"] .hot-search span,
html[data-theme="dark"] .stats,
html[data-theme="dark"] .hero-action-row>span{color:#9499a2}
html[data-theme="dark"] .hero-eyebrow b{border-color:#586b27;background:#1c2511;color:#c9f56a;box-shadow:none}
html[data-theme="dark"] .hero-search>div{border-color:#343943;background:#171a20;box-shadow:0 16px 42px #0007}
html[data-theme="dark"] .hero-search input{color:#fff}
html[data-theme="dark"] .hot-search button{background:#1a1d23;color:#aeb3bc}
html[data-theme="dark"] .stats{border-color:#303540}
html[data-theme="dark"] .screen,
html[data-theme="dark"] .portrait-art figure,
html[data-theme="dark"] .visual-art figure{border-color:#4d5058;background:#171920;box-shadow:0 18px 48px #000a}
html[data-theme="dark"] .verified{border-color:#4e5159;background:#0b0c0fcc;color:#d7d7d8}
html[data-theme="dark"] .hero-controls button{border-color:#2f333b;background:#0b0c0f;color:#818690}
html[data-theme="dark"] .hero-controls button.active{border-color:#5d6067;color:#fff}
html[data-theme="dark"] .hero-controls i{background:#343942}

html[data-theme="dark"] .categories,
html[data-theme="dark"] .collections,
html[data-theme="dark"] .workflow,
html[data-theme="dark"] .library-section,
html[data-theme="dark"] .explore-browse{background:#090a0d}
html[data-theme="dark"] .featured{border-color:#303540;background:#07080a}
html[data-theme="dark"] .category-grid,
html[data-theme="dark"] .category-grid a,
html[data-theme="dark"] .workflow-grid,
html[data-theme="dark"] .workflow article{border-color:#303540}
html[data-theme="dark"] .category-grid a:hover,
html[data-theme="dark"] .category-grid a.highlight{background:#1e2229}
html[data-theme="dark"] .category-grid small,
html[data-theme="dark"] .category-grid span,
html[data-theme="dark"] .workflow article>small,
html[data-theme="dark"] .workflow p{color:#858b95}
html[data-theme="dark"] .prompt-card,
html[data-theme="dark"] .library-card,
html[data-theme="dark"] .detail-related-card,
html[data-theme="dark"] .explore-prompt-card{border-color:#30343e;background:#181b22;color:#f7f8fb;box-shadow:0 14px 36px #0005}
html[data-theme="dark"] .prompt-card h3,
html[data-theme="dark"] .library-card h3,
html[data-theme="dark"] .detail-related-card h3,
html[data-theme="dark"] .explore-prompt-card h3 a{color:#f7f8fb}
html[data-theme="dark"] .card-body>p,
html[data-theme="dark"] .card-body footer span,
html[data-theme="dark"] .library-card small,
html[data-theme="dark"] .library-card p,
html[data-theme="dark"] .detail-related-card small,
html[data-theme="dark"] .detail-related-card p,
html[data-theme="dark"] .explore-prompt-card p{color:#8f949e}
html[data-theme="dark"] .card-body footer,
html[data-theme="dark"] .library-card footer,
html[data-theme="dark"] .detail-related-card footer,
html[data-theme="dark"] .explore-prompt-card footer{border-color:#303540}
html[data-theme="dark"] .ranking{border-color:#303540;background:#111319}
html[data-theme="dark"] .ranking-copy p,
html[data-theme="dark"] .ranking li a span,
html[data-theme="dark"] .ranking li>small{color:#858b95}
html[data-theme="dark"] .ranking li{border-color:#30343c}
html[data-theme="dark"] .outline-button{border-color:#343944;background:transparent}
html[data-theme="dark"] .footer{border-color:#303540;background:#111319}
html[data-theme="dark"] .footer-main>div>p,
html[data-theme="dark"] .footer nav{color:#a7abb4}
html[data-theme="dark"] .footer nav>strong,
html[data-theme="dark"] .footer nav small,
html[data-theme="dark"] .content-note p,
html[data-theme="dark"] .copyright{color:#747a84}
html[data-theme="dark"] .content-note,
html[data-theme="dark"] .content-note>div{border-color:#303540}

html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .compact-hero{border-color:#303540;background:radial-gradient(circle at 78% 28%,rgba(255,99,71,.13),transparent 36%),#111318}
html[data-theme="dark"] .portrait-tone{background:radial-gradient(circle at 78% 30%,rgba(96,72,42,.22),transparent 40%),#191714}
html[data-theme="dark"] .visual-tone{background:radial-gradient(circle at 76% 28%,rgba(255,99,71,.18),transparent 38%),linear-gradient(118deg,#0c0d10,#161411 58%,#0c0d10)}
html[data-theme="dark"] .page-hero:before{background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px)}
html[data-theme="dark"] .page-hero p,
html[data-theme="dark"] .compact-hero aside p{color:#a1a5ad}
html[data-theme="dark"] .page-hero-collage figure{border-color:#3a3d43;background:#17191e;box-shadow:0 25px 80px #000}
html[data-theme="dark"] .compact-hero aside{border-color:#464b55}

/* Keep the original mixed dark palette: visual libraries remain warm and light. */
html[data-theme="dark"] .light-library{
  border-color:#d8d3ca;
  background:#efede7;
  color:#171512;
}
html[data-theme="dark"] .portrait-library{background:#f3f0eb}
html[data-theme="dark"] .light-library h2,
html[data-theme="dark"] .light-library h3{color:#171512}
html[data-theme="dark"] .light-library>header>small{color:#705847}
html[data-theme="dark"] .light-library>header p{color:#65615a}
html[data-theme="dark"] .light-library .library-card{
  border-color:#d8d3ca;
  background:#faf9f6;
  color:#171512;
  box-shadow:0 12px 34px rgba(50,42,33,.08);
}
html[data-theme="dark"] .portrait-library .library-card{border-color:#dedbd5;background:#fff}
html[data-theme="dark"] .light-library .library-card h3{color:#171512}
html[data-theme="dark"] .light-library .library-card small,
html[data-theme="dark"] .light-library .library-card p,
html[data-theme="dark"] .light-library .library-card footer span{color:#6e6a64}
html[data-theme="dark"] .light-library .library-card footer{border-color:#dedbd5}
html[data-theme="dark"] .light-library .library-card footer b{color:#be4d38}
html[data-theme="dark"] .light-library .filter-chips button{
  border-color:#d8d3ca;
  background:#f8f6f1;
  color:#4f4c47;
}
html[data-theme="dark"] .light-library .filter-chips button.active{
  border-color:#171512;
  background:#171512;
  color:#fff;
}
html[data-theme="dark"] .light-library .empty-state.light{border-color:#cfcac0;background:#f7f4ef;color:#171512}
html[data-theme="dark"] .light-library .empty-state.light p{color:#77716a}
html[data-theme="dark"] .filter-chips button,
html[data-theme="dark"] .rank-tabs button{border-color:#363941;background:#14161b;color:#b8bbc2}
html[data-theme="dark"] .filter-chips button.active,
html[data-theme="dark"] .rank-tabs button.active{background:#f1eee6;color:#101114}
html[data-theme="dark"] .module-grid{border-color:#33363d;background:#33363d}
html[data-theme="dark"] .module-grid a{background:#111318;color:#f4f1e9}
html[data-theme="dark"] .module-grid a:hover{background:#181b21}
html[data-theme="dark"] .module-grid span{color:#838792}
html[data-theme="dark"] .collection-rail{border-color:#303540;background:#0b0c0f;color:#787d86}
html[data-theme="dark"] .collection-list{background:#0b0c0f}
html[data-theme="dark"] .rank-board,
html[data-theme="dark"] .rank-board li,
html[data-theme="dark"] .guide-steps>article,
html[data-theme="dark"] .faq details,
html[data-theme="dark"] .category-row{border-color:#35383f}
html[data-theme="dark"] .guide-demo{border-color:#3d414a;background:linear-gradient(135deg,#191c22,#0c0e12);box-shadow:none}
html[data-theme="dark"] .guide-demo span{border-color:#b9f45b;background:#24272e;color:#ddd}

html[data-theme="dark"] .explore-head{border-color:#303540;background:linear-gradient(135deg,#111318,#0b0c0f)}
html[data-theme="dark"] .explore-head-title h1{color:#f7f8fb}
html[data-theme="dark"] .explore-head-title p{color:#9b9fa8}
html[data-theme="dark"] .explore-head form label{border-color:#444851;background:#17191e;box-shadow:0 20px 52px #0006}
html[data-theme="dark"] .explore-head form input{color:#fff}
html[data-theme="dark"] .filter-panel{border-color:#2d3036;background:#101216}
html[data-theme="dark"] .filter-panel header,
html[data-theme="dark"] .filter-panel fieldset,
html[data-theme="dark"] .explore-results>header{border-color:#303540}
html[data-theme="dark"] .filter-radio,
html[data-theme="dark"] .explore-results>header>span{color:#a5a9b2}
html[data-theme="dark"] .filter-radio:has(input:checked),
html[data-theme="dark"] .explore-results>header>span b{color:#f7f8fb}
html[data-theme="dark"] .explore-results select{background:#15171c;color:#fff}

html[data-theme="dark"] .article-toolbar{border-color:#303540;color:#8e939d}
html[data-theme="dark"] .article-toolbar button{border-color:#303540;background:#15171c;color:#d4d7dc}
html[data-theme="dark"] .article-title-block>p,
html[data-theme="dark"] .article-meta,
html[data-theme="dark"] .ready-panel>p,
html[data-theme="dark"] .usage-cards p,
html[data-theme="dark"] .creator-card>p,
html[data-theme="dark"] .example-box small{color:#9b9fa8}
html[data-theme="dark"] .article-cover{border-color:#303540;background:#17191e;box-shadow:0 18px 48px #0007}
html[data-theme="dark"] .ready-panel,
html[data-theme="dark"] .usage-cards article,
html[data-theme="dark"] .example-box,
html[data-theme="dark"] .creator-card{border-color:#303540;background:#15171c;box-shadow:0 12px 34px #0004}
html[data-theme="dark"] .ready-panel footer,
html[data-theme="dark"] .creator-card dl>div,
html[data-theme="dark"] .example-box>header,
html[data-theme="dark"] .example-box>footer{border-color:#303540}
html[data-theme="dark"] .example-box>footer{background:#101217}

html[data-theme="dark"] .site-modal,
html[data-theme="dark"] .report-modal,
html[data-theme="dark"] .platform-modal{border-color:#484e59;background:#191c22;color:#f7f8fb;box-shadow:0 30px 100px #0009}
html[data-theme="dark"] .site-modal-close{border-color:#3c424c;background:#22262d;color:#bcc1c9}
html[data-theme="dark"] .site-modal input,
html[data-theme="dark"] .report-modal textarea{border-color:#3d434d;background:#101217;color:#fff}
html[data-theme="dark"] .report-reasons button{border-color:#3c424c;background:#111318;color:#bec2c9}
html[data-theme="dark"] .platform-card{border-color:#343a45;background:#0f1217}
html[data-theme="dark"] .site-toast{border-color:#59606b;background:#171a20;color:#fff;box-shadow:0 15px 50px #0008}

html[data-theme="dark"] .collection-card h3,
html[data-theme="dark"] .collection-card p,
html[data-theme="dark"] .final-cta h2,
html[data-theme="dark"] .final-cta,
html[data-theme="dark"] .collection-row-local h2,
html[data-theme="dark"] .collection-row-local h3,
html[data-theme="dark"] .method-strip,
html[data-theme="dark"] .method-strip h2,
html[data-theme="dark"] .method-strip h3,
html[data-theme="dark"] .ranking-note h3{color:#111318}
html[data-theme="dark"] .guide-hero-exact h1{color:#111318}
html[data-theme="dark"] .guide-hero-exact h1 em{color:#fff}

@media(hover:hover) and (pointer:fine){
  html[data-theme="dark"] .primary-button:hover,
  html[data-theme="dark"] .hero-search button:hover,
  html[data-theme="dark"] .explore-head form button:hover{background:#fff;color:#101115;box-shadow:0 16px 34px #0009}
  html[data-theme="dark"] .prompt-card:hover,
  html[data-theme="dark"] .library-card:hover,
  html[data-theme="dark"] .detail-related-card:hover,
  html[data-theme="dark"] .explore-prompt-card:hover{border-color:#626873;box-shadow:0 22px 48px #0008}
  html[data-theme="dark"] .light-library .library-card:hover{border-color:#aaa49a;box-shadow:0 22px 48px rgba(48,40,31,.15)}
  html[data-theme="dark"] .workflow article:hover,
  html[data-theme="dark"] .ranking li:hover,
  html[data-theme="dark"] .rank-board li:hover,
  html[data-theme="dark"] .category-row:hover{background:#ffffff05}
}

::view-transition-old(root),::view-transition-new(root){animation-duration:560ms;animation-timing-function:var(--ease-soft)}
::view-transition-old(root){animation-name:theme-old-fade}
::view-transition-new(root){animation-name:theme-new-reveal;mix-blend-mode:normal}
@keyframes theme-old-fade{to{opacity:.18;filter:saturate(.75)}}
@keyframes theme-new-reveal{from{clip-path:circle(0 at calc(100% - 110px) 34px);filter:saturate(.7)}to{clip-path:circle(150% at calc(100% - 110px) 34px);filter:saturate(1)}}

@media(max-width:720px){
  html{scroll-padding-top:76px}
  .site-shell{padding-top:62px}
  .site-header{gap:8px}
  .theme-toggle{width:52px;height:32px;flex-basis:52px;margin-left:auto}
  .theme-toggle-orb{width:24px;height:24px}
  html[data-theme="dark"] .theme-toggle-orb{transform:translate3d(20px,0,0) rotate(180deg)}
  .mobile-menu-button{margin-left:0}
  html[data-theme="dark"] .mobile-menu-button span{background:#e1e3e6}
  html[data-theme="dark"] .mobile-drawer{background:rgba(14,16,21,.985);color:#f7f8fb}
  html[data-theme="dark"] .drawer-head button{border-color:#353a43;background:#20232a;color:#fff}
  html[data-theme="dark"] .drawer-search,
  html[data-theme="dark"] .drawer-cats a{border-color:#343944;background:#1a1d22}
  html[data-theme="dark"] .drawer-search input{color:#fff}
  html[data-theme="dark"] .mobile-drawer nav,
  html[data-theme="dark"] .mobile-drawer nav a{border-color:#2d3139}
}

@media(prefers-reduced-motion:reduce){
  ::view-transition-old(root),::view-transition-new(root){animation:none!important}
  .theme-toggle-track,.theme-toggle-orb,.theme-toggle .icon{transition-duration:.01ms!important}
}
