/* KALEIDO — independent five-palette daytime selector.
   Loaded last. No filters on illustrations, no changes to night mode. */
html[data-light-palette="paper"]{
 --ka-day-bg:#F4F0E7;--ka-day-surface:#FCFAF6;--ka-day-ink:#292D2A;
 --ka-day-border:#D8D1C7;--ka-day-control:#ECE7DC;
}
html[data-light-palette="sage"]{
 --ka-day-bg:#E8EEE8;--ka-day-surface:#F5F8F4;--ka-day-ink:#2D312E;
 --ka-day-border:#D0DCD1;--ka-day-control:#DEE7DE;
}
html[data-light-palette="pearl"]{
 --ka-day-bg:#EFF2F3;--ka-day-surface:#FAFBFC;--ka-day-ink:#242C31;
 --ka-day-border:#D1D9DB;--ka-day-control:#E0E6E8;
}
html[data-light-palette="linen"]{
 --ka-day-bg:#EDE5D9;--ka-day-surface:#F8F3EB;--ka-day-ink:#302B27;
 --ka-day-border:#D8CBB9;--ka-day-control:#E4D8C7;
}
html[data-light-palette="porcelain"]{
 --ka-day-bg:#FAF8F5;--ka-day-surface:#FFFFFF;--ka-day-ink:#2B2D2D;
 --ka-day-border:#E5E0D8;--ka-day-control:#F1EDE8;
}
html[data-light-palette] body:not(.nightMode){
 --paper:var(--ka-day-bg);
 --surface:var(--ka-day-surface);
 --control:var(--ka-day-control);
 --ink:var(--ka-day-ink);
 --line:var(--ka-day-border);
 color-scheme:light;
}
html[data-light-palette] body:not(.nightMode) .app{
 background:var(--ka-day-bg)!important;
 color:var(--ka-day-ink);
}
html[data-light-palette] body:not(.nightMode) :is(
 .card,.empty,.livePreviewCard,.readerSheet,.readerHead,.dbPanel,
 .list .recentBooksRow>.card.recentBookCard
){
 background:var(--ka-day-surface)!important;
 color:var(--ka-day-ink);
 border-color:var(--ka-day-border);
}
html[data-light-palette] body:not(.nightMode) :is(.search,.searchRow .search,.readerBody){
 background:var(--ka-day-surface)!important;
 color:var(--ka-day-ink);
 border-color:var(--ka-day-border);
}
html[data-light-palette] body:not(.nightMode) :is(.tabs,.viewSwitch,.timeChip){
 background:var(--ka-day-control);
 border-color:var(--ka-day-border);
}
html[data-light-palette] body:not(.nightMode) :is(.tab.active,.viewBtn.active,.bottomNav){
 background:var(--ka-day-surface);
}
html[data-light-palette] body:not(.nightMode) :is(
 .sectionHead h2,.cardTitle,.details,.readerTitle,.catalogGroupLabel
){color:var(--ka-day-ink)}

/* A compact row inside the existing constellation menu. */
#headerMenu .headerMenuDayPaletteRow{
 display:flex;flex-direction:column;align-items:stretch;justify-content:center;
 gap:7px;min-height:0;padding:10px 8px 12px;cursor:default;
}
#headerMenu .headerMenuDayPaletteRow:hover{background:rgba(221,239,249,.04)}
#headerMenu .lightPaletteHeading{
 display:flex;align-items:baseline;justify-content:space-between;
 gap:8px;min-width:0;width:100%;
}
#headerMenu .lightPaletteHeading .headerMenuLabel{flex:0 1 auto}
#headerMenu .lightPaletteSelectedName{
 font:500 10px/1.25 var(--ui-font,system-ui);color:#d8cba8;
 text-align:right;white-space:nowrap;overflow:hidden;
 text-overflow:ellipsis;max-width:58%;min-width:0;
}
#headerMenu .lightPaletteChoices{
 display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
 align-items:center;justify-items:center;gap:3px;width:100%;min-width:0;
}
#headerMenu .lightPaletteSwatch{
 position:relative;display:grid;place-items:center;
 width:100%;min-width:38px;height:40px;padding:0;
 background:none;border:0;border-radius:12px;
 cursor:pointer;-webkit-tap-highlight-color:transparent;
}
#headerMenu .lightPaletteSwatch::before{
 content:"";width:28px;height:28px;box-sizing:border-box;
 background:var(--swatch);border-radius:50%;
 border:1px solid rgba(255,255,255,.25);
 box-shadow:0 1px 3px rgba(0,0,0,.21),inset 0 0 0 1px rgba(0,0,0,.05);
}
#headerMenu .lightPaletteSwatch[aria-pressed="true"]::before{
 outline:2px solid #f1cf8d;outline-offset:3px;
}
#headerMenu .lightPaletteSwatch[aria-pressed="true"]::after{
 content:"";position:absolute;width:5px;height:5px;border-radius:50%;
 background:#29302b;box-shadow:0 0 0 1px rgba(255,255,255,.7);
}
#headerMenu .lightPaletteSwatch:focus-visible{
 outline:2px solid #f4dbab;outline-offset:1px;
}
#headerMenu .lightPaletteSwatch:hover{background:rgba(244,216,165,.08)}
body.nightMode #headerMenu .headerMenuDayPaletteRow{display:none!important}
@media(prefers-reduced-motion:no-preference){
 #headerMenu .lightPaletteSwatch::before{
  transition:outline-color .12s ease,box-shadow .12s ease;
 }
}
