/* Shared appearance control; the catalogue layout supplies the day palette. */
.page-header{grid-template-columns:44px minmax(0,1fr) auto}
.page-header :is(h1,.page-title){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.page-header-tools{display:flex;align-items:center;justify-content:flex-end;gap:2px}
.page-header-tools>.text-button{white-space:nowrap;font-size:13px}
.theme-toggle{border:1px solid var(--line);background:var(--sage)}
.theme-toggle .icon{width:21px;height:21px}
.theme-toggle .theme-sun{display:none}
.brand-header>.brand{min-width:0}
.brand-header .brand small{overflow:hidden;text-overflow:ellipsis;max-width:100%}
.brand-header .header-actions{flex-shrink:0}
@media(max-width:540px){
  .page-header{grid-template-columns:40px minmax(0,1fr) auto;gap:5px}
  .page-header-tools{gap:0}
  .page-header-tools>.text-button{font-size:12px}
  .brand-header .theme-toggle .icon{width:21px;height:21px}
}
@media(max-width:360px){.brand-header .brand small{letter-spacing:0;font-size:10px}.brand-header{gap:7px}}

:root[data-site-theme=dark],:root[data-site-theme=dark] .reader-shell{
  color-scheme:dark;
  --paper:#19191e;
  --paper-deep:#131317;
  --ink:#efedf1;
  --green:#f29973;
  --green-hover:#ffb28c;
  --sage:#26262e;
  --muted:#b7b3bd;
  --line:#42414c;
  --white:#26150e;
  --gold:#e5ac68;
  --danger:#f09c8e;
}
:root[data-site-theme=dark] body{background:#111115}
:root[data-site-theme=dark] .theme-moon{display:none}
:root[data-site-theme=dark] .theme-sun{display:block}
:root[data-site-theme=dark] ::selection{background:#654736;color:#fff}
:root[data-site-theme=dark] mark{background:#68553a;color:var(--ink)}
:root[data-site-theme=dark] .app-shell{box-shadow:0 8px 65px #0003}
:root[data-site-theme=dark] .bottom-nav{background:#19191ef5}
:root[data-site-theme=dark] .bottom-nav a{color:var(--muted)}
:root[data-site-theme=dark] .bottom-nav a[aria-current=page]{color:var(--green)}
:root[data-site-theme=dark] :is(.bottom-nav a[aria-current=page] .icon,.quick-nav .icon,.action-pair [aria-pressed=true] .icon){fill:#f2997326}
:root[data-site-theme=dark] :is(.brand small,.site-footer,.author,.comic-summary,.quote-band p,.auth-brand p,.handwriting,.auth-heading p,.demo-note,.form-notice,.library-banner p,.invite-hero p,.result-description,.rank-info>p,.rank-info>small,.prose>p,.reader-subtitle){color:var(--muted)}
:root[data-site-theme=dark] :is(.search-field>.icon,.input-wrap .icon-button,.continue-card>.icon,.quote-band>.icon,.download-hero>.icon,.library-banner>.icon){color:var(--green)}
:root[data-site-theme=dark] :is(.filter-panel,.tag-cloud,.home-ranking,.library-banner,.tags .status){background:var(--sage)}
:root[data-site-theme=dark] :is(.continue-card,.menu-row,.library-card,.rank-card,.update-list,.invite-card,.input-wrap,.info-panel textarea){background:var(--paper-deep);border-color:var(--line)}
:root[data-site-theme=dark] :is(.chapter-row,.filter-row,.reader-panel){border-color:var(--line)}
:root[data-site-theme=dark] .rank-1{border-color:#82764e}
:root[data-site-theme=dark] .rank-3{border-color:#755e42}
:root[data-site-theme=dark] :is(.quick-nav a:hover,.tags>a:hover,.button.secondary:hover,.icon-button:hover){background:#3c3540}
:root[data-site-theme=dark] :is(.pagination button,.tag-pagination>a,.tag-pagination>.page-disabled){background:var(--paper-deep)}
:root[data-site-theme=dark] :is(.pagination button[aria-current=page],.tag-pagination>a[aria-current=page],.filter-row button[aria-pressed=true],.rank-tabs [role=tab][aria-selected=true]){background:var(--green);color:var(--white);border-color:var(--green)}
:root[data-site-theme=dark] :is(.pagination button:disabled,.tag-pagination>.page-disabled){background:var(--sage)}
:root[data-site-theme=dark] .chapter-row:hover{color:var(--green)}
:root[data-site-theme=dark] .auth-art-shade{background:linear-gradient(90deg,var(--paper) 0%,#19191eef 22%,#19191e42 62%,transparent),linear-gradient(0deg,var(--paper),transparent 38%)}
:root[data-site-theme=dark] .invite-shade{background:linear-gradient(90deg,var(--paper) 1%,#19191edc 27%,transparent 90%),linear-gradient(0deg,var(--paper),transparent 50%)}
:root[data-site-theme=dark] :is(input,textarea)::placeholder{color:#aaa6b0}
:root[data-site-theme=dark] .scroll-top{background:var(--sage);color:var(--ink)}
:root[data-site-theme=dark] .scroll-top.comic-scroll-top{background:var(--green);color:var(--white);border-color:var(--line)}
:root[data-site-theme=dark] .scroll-top.comic-scroll-top:hover{background:var(--green-hover)}
:root[data-site-theme=dark] .skip-link{background:var(--green);color:var(--white)}
:root[data-site-theme=dark] .storage-warning{background:#423b25;color:#e5cd92}
:root[data-site-theme=dark] .noscript-notice{background:var(--sage)}
:root[data-site-theme=dark] .modal::backdrop{background:#07070ba6}
:root[data-site-theme=dark] .switch-row input{background:#65616e}
:root[data-site-theme=dark] .switch-row input:checked{background:#8b4c31}
:root[data-site-theme=dark] .theme-swatch{border-color:#757080}
:root[data-site-theme=dark] .theme-options label:has(input:checked) .theme-swatch{outline-color:var(--green)}
@media print{.theme-toggle{display:none!important}}

/* Search hints follow this template's active theme tokens. */
:root input[type=search]::placeholder,:root[data-site-theme] input[type=search]::placeholder{color:var(--muted);opacity:1}
