:root { color-scheme:light; --paper:#EEE8DD; --card:#FFFDF8; --ink:#172B3A; --accent:#B65F46; --line:#c5c0b6; --soft:#eae3d6; --muted:#334A58; --link:#713c2c; }
:root[data-reading-color="sage"] { --paper:#DCE8DF; --card:#F8FDF9; --line:#A8BAB0; --soft:#CFE0D4; }
:root[data-reading-color="sky"] { --paper:#DCE7F0; --card:#F9FCFF; --line:#A9BAC8; --soft:#CEDDEA; }
:root[data-reading-color="lavender"] { --paper:#E6DFF0; --card:#FCFAFF; --line:#B9AEC8; --soft:#DACEE8; }
:root[data-reading-color="rose"] { --paper:#F0DFE2; --card:#FFF9FA; --line:#C8AFB5; --soft:#E8CED5; }
:root[data-reading-color="peach"] { --paper:#F1E1D1; --card:#FFFBF6; --line:#C9B5A1; --soft:#E8D5BE; }
:root[data-reading-color="mist"] { --paper:#DFE4E6; --card:#FAFCFD; --line:#AEB9BF; --soft:#D0DADF; }
html,body { background:var(--paper); color:var(--ink); }
[hidden] { display:none!important; }
.reading-theme { position:relative; font:14px/1.5 system-ui,sans-serif; color:var(--ink); }
.reading-theme .theme-toggle { display:flex; align-items:center; gap:8px; width:auto; min-height:44px; margin:0; padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink); font:inherit; cursor:pointer; }
.theme-swatch { display:inline-block; flex-shrink:0; width:22px; height:22px; border:1px solid #687883; border-radius:50%; background:var(--paper); }
.theme-swatch-paper { background:#EEE8DD; }
.theme-swatch-sage { background:#DCE8DF; }
.theme-swatch-sky { background:#DCE7F0; }
.theme-swatch-lavender { background:#E6DFF0; }
.theme-swatch-rose { background:#F0DFE2; }
.theme-swatch-peach { background:#F1E1D1; }
.theme-swatch-mist { background:#DFE4E6; }
.reading-theme .theme-panel { position:absolute; right:0; top:calc(100% + 8px); z-index:30; width:260px; max-width:calc(100vw - 32px); padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--card); box-shadow:0 10px 30px #172b3a26; }
.reading-theme fieldset { margin:0; padding:0; border:0; min-width:0; }
.reading-theme legend { font:600 14px/1.5 system-ui,sans-serif; padding:0 6px 8px; }
.reading-theme .theme-option { display:flex; align-items:center; gap:10px; min-height:44px; padding:6px; margin:2px 0; border-radius:6px; cursor:pointer; }
.reading-theme .theme-option:has(input:checked) { background:var(--paper); font-weight:650; }
.reading-theme input { width:18px; height:18px; min-height:0; margin:0; accent-color:var(--ink); }
.theme-check { margin-left:auto; visibility:hidden; }
.theme-option:has(input:checked) .theme-check { visibility:visible; }
.reading-theme .theme-hint { margin:8px 6px 0; color:var(--muted); font-size:12px; }
.reading-theme :focus { outline:3px solid var(--ink); outline-offset:3px; }
.reading-theme .theme-option:has(input:focus) { outline:3px solid var(--ink); outline-offset:1px; }
@media(max-width:500px) { .reading-theme .theme-panel { right:auto; left:0; } }
