.settings-tabs { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
#theme-settings { min-width: 0; }
.theme-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.theme-choice { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--panel); padding: 14px; border-radius: 10px; cursor: pointer; }
.theme-choice:has(input:checked) { border-color: var(--accent); outline: 1px solid var(--accent); }
.theme-choice input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--accent); }
.theme-choice-copy { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.theme-choice strong { font-size: 13px; }
.theme-choice small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.theme-swatches { display: flex; flex: 0 0 36px; height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.theme-swatches i { flex: 1; background: #090a0b; }.theme-swatches i:nth-child(2) { background: #191d22; }.theme-swatches i:nth-child(3) { background: #4fbeed; }
.theme-choice-dark i { background: #111318; }.theme-choice-dark i:nth-child(2) { background: #1b1e26; }.theme-choice-dark i:nth-child(3) { background: #9b8aff; }
.theme-choice-light i { background: #f2f4f8; }.theme-choice-light i:nth-child(2) { background: #fff; }.theme-choice-light i:nth-child(3) { background: #5941c8; }
.theme-choice-system .theme-swatches { background: linear-gradient(135deg, #1b1e26 50%, #f2f4f8 50%); }.theme-choice-system i { background: transparent; }
.theme-choice-custom i { background: var(--paper); }.theme-choice-custom i:nth-child(2) { background: var(--panel); }.theme-choice-custom i:nth-child(3) { background: var(--accent); }
.theme-color-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.theme-color-field { display: grid; gap: 8px; font-size: 12px; }
.theme-color-row { display: flex; gap: 8px; }
.theme-color-row input[type=color] { flex: 0 0 46px; width: 46px; height: 42px; padding: 3px; cursor: pointer; }
.theme-color-row input[type=text] { min-width: 0; font-family: monospace; }
.theme-color-row input[aria-invalid=true] { border-color: var(--red); }
.theme-preview { padding: 20px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; margin: 24px 0 12px; }
.theme-preview small { color: var(--accent); font-size: 10px; letter-spacing: .1em; }.theme-preview h3 { margin: 12px 0; }.theme-preview p { color: var(--muted); font-size: 13px; }
.theme-status,.theme-contrast { color: var(--muted); font-size: 12px; line-height: 1.6; }
/* Only non-Tau palettes override legacy fixed foregrounds and reader paper. */
:root:not([data-theme-resolved=tau])[data-theme] .primary { background: var(--accent); color: var(--theme-on-accent); }
:root:not([data-theme-resolved=tau])[data-theme] .primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent), var(--ink) 12%); }
:root:not([data-theme-resolved=tau])[data-theme] .learn-paper { background: var(--panel); color: var(--ink); }
:root:not([data-theme-resolved=tau])[data-theme] .learn-lesson.active { color: var(--ink); }
:root:not([data-theme-resolved=tau])[data-theme] .learn-paper .muted { color: var(--muted); }
:root:not([data-theme-resolved=tau])[data-theme] .learn-card-art { color: var(--accent); }
:root:not([data-theme-resolved=tau])[data-theme] :focus-visible { outline-color: var(--accent); }
@media (max-width: 520px) { .theme-choices,.theme-color-fields { grid-template-columns: minmax(0, 1fr); } .settings-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
