/* Approved Reydar 1.1 palette; existing names remain aliases for workflow styles. */
:root,[data-theme=light]{
 --bg:#faf7f2;--paper:#ffffff;--ink:#211c27;--muted:#655b6b;--line:#d8cfda;
 --green:#6926c9;--light:#f0e8fb;--orange:#b94425;--shadow:0 8px 35px #211c2708;
 --surface-soft:#f1ece8;--surface-hover:#f3edf9;--control-bg:#ffffff;--control-border:#918198;
 --accent-fill:#6926c9;--accent-hover:#54209f;--on-accent:#ffffff;--focus:#6926c9;
 --success-bg:#eaf5ee;--success-ink:#22734a;--info-bg:#edf0fc;--info-ink:#3c4f94;
 --warning-bg:#fff4de;--warning-ink:#805600;--danger-bg:#fff0f3;--danger-ink:#b92c49;
 --preview-bg:#f1ece8;--overlay:#211c27ed;--overlay-ink:#faf7f2;--backdrop:#18151e80;
 --control-menu-shadow:0 12px 35px #211c2726;
 --control-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23655b6b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
 color-scheme:light;
}
:root[data-theme=dark]{
 --bg:#18151e;--paper:#231e2a;--ink:#faf7f2;--muted:#bcb2c5;--line:#514459;
 --green:#c4a5ff;--light:#302439;--orange:#ffac91;--shadow:0 8px 35px #00000026;
 --surface-soft:#2d2635;--surface-hover:#362c40;--control-bg:#231e2a;--control-border:#82718b;
 --accent-fill:#c4a5ff;--accent-hover:#d7c1ff;--on-accent:#18151e;--focus:#c4a5ff;
 --success-bg:#22382c;--success-ink:#7bd7a6;--info-bg:#28324a;--info-ink:#bdcbff;
 --warning-bg:#3c301b;--warning-ink:#f0c66a;--danger-bg:#402530;--danger-ink:#ff9dae;
 --preview-bg:#18151e;--overlay:#231e2af5;--overlay-ink:#faf7f2;--backdrop:#100d15bb;
 --control-menu-shadow:0 16px 45px #00000066;
 --control-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23bcb2c5' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
 color-scheme:dark;
}
html body{background:var(--bg);color:var(--ink)}
html body :is(.sidebar,.topbar,.stat,.post,.empty,.panel,.analysis-entry,.discovery-result,.feed-filter-panel,.creator-lookup-card,.catalogue-match,.suggestion-card,.format-card,.single-post-result,.dashboard-overview,.modal-head,.script-editor-actions,.favorites-toggle,.saved-toggle),html dialog{background-color:var(--paper);color:var(--ink);border-color:var(--line)}
html body .discovery-panel{background:linear-gradient(120deg,var(--light),var(--paper));border-color:var(--line)}
html body :is(.analysis-source,.script-live-preview,.transcript-audit,.library-alternatives,.writing-command,.discovery-empty){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
html body :is(.post-media,.image-post .post-media,.reference-summary img,.analysis-toggle img,.analysis-reference>img,.post-gallery>img){background-color:var(--preview-bg)}
/* Native and enhanced controls share the same surfaces; preserve select chevrons. */
html body button{background-color:var(--paper);color:var(--ink);border-color:var(--control-border)}
html body button:hover{background-color:var(--surface-hover);border-color:var(--control-border)}
html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),textarea,select),html body .floating-picker-menu input:not([type=checkbox]):not([type=radio]),html body #newFormatForm textarea{background-color:var(--control-bg);color:var(--ink);border-color:var(--control-border)}
html body :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
html body :is(input,textarea):focus-visible{background-color:var(--paper)}
html body :is(.creator-picker,.script-choice-picker)>summary,html body button.ui-select-trigger{background-color:var(--paper);background-image:var(--control-chevron);color:var(--ink);border-color:var(--control-border)}
html body :is(.creator-picker,.script-choice-picker)>summary:hover,html body button.ui-select-trigger:hover{background-color:var(--surface-hover)}
html body :is(.creator-options,.script-choice-options,.ui-select-menu,.post-menu-items,.floating-picker-menu){background:var(--paper);color:var(--ink);border-color:var(--control-border);box-shadow:var(--control-menu-shadow)}
html body :is(.creator-options,.script-choice-options,.ui-select-menu,.post-menu-items) :is(button,a){background:transparent;color:var(--ink)}
html body :is(.creator-options,.script-choice-options,.ui-select-menu,.post-menu-items) :is(button,a):hover{background:var(--surface-hover);color:var(--ink)}
html body :is(.creator-picker-footer,.floating-picker-menu .creator-picker-footer){background:var(--paper);border-color:var(--line)}
html body :is(.nav,.quiet,.manage-link,.analysis-toggle,.star-analysis,.discovery-tabs button,.post .creatorline .creator-name){background-color:transparent}
html body .nav{color:var(--muted)}
html body :is(.nav.active,.tabs .selected,.watchlist-bar button[aria-pressed=true],.feed-quick-views button[aria-pressed=true],.analysis-tabbar button[aria-selected=true],.writing-angle-options button[aria-pressed=true],.creator-options button[aria-pressed=true],.ui-select-menu button[aria-selected=true],.script-choice-options button[aria-pressed=true],.discovery-tabs button[aria-pressed=true]){background:var(--light);color:var(--green);border-color:var(--control-border)}
html body :is(.primary,.new-script-menu>summary){background:var(--accent-fill)!important;color:var(--on-accent)!important;border-color:var(--accent-fill)!important}
html body .new-script-menu>summary span{color:var(--on-accent)!important}
html body :is(.primary,.new-script-menu>summary):hover{background:var(--accent-hover)!important;border-color:var(--accent-hover)!important}
html[data-theme=dark] body .new-script-menu>summary:after{filter:none}
html body :is(.post-footer button,.suggestion-card button,.creator-picker-footer button,.tag,.pill,.filter-icon,.avatar,.creator-option-initial,.empty .orb,.outlier){background:var(--light);color:var(--green);border-color:var(--line)}
html body :is(.tiny,.metrics,.metrics b,.library-metrics,.draft-preview,.creator-description,.creator-preview-bio,.creator-followers,.filter-check,.inline-switch,.filter-options .note,.recovery-row p,.preview-section h3,.suggestion-card>small,.suggestion-group h4,.script-choice-options small,.format-card small,.range-inputs>span,.filter-title,.script-editor-fields .field label,.post-menu summary){color:var(--muted)}
html body :is(.metrics .metric-unavailable,.metrics .metric-unavailable b,.library-metrics .metric-unavailable,.library-metrics .metric-unavailable b){color:var(--muted)}
html body :is(.creator-tick,.creator-followers,.quiet,.manage-link){color:var(--green)}
html body :is(.discovery-result,.catalogue-match):hover,html body .post-menu summary:hover{background:var(--surface-hover);border-color:var(--control-border)}
html body :is(.metrics,td,.creator-picker-footer,.format-example,.script-live-preview,.preview-section){border-color:var(--line)}
/* Textual status labels keep meaning independent of hue. */
html body :is(.status-done,.banner:not(.warning)){background:var(--success-bg)!important;color:var(--success-ink)!important;border-color:var(--line)}
html body :is(.status-running,.status-queued){background:var(--info-bg)!important;color:var(--info-ink)!important}
html body :is(.status-review,.tag.review,.banner.warning,.writing-unknowns){background:var(--warning-bg)!important;color:var(--warning-ink)!important;border-color:var(--line)}
html body :is(.status-failed,.tag.failed){background:var(--danger-bg)!important;color:var(--danger-ink)!important}
html body :is(.danger,.post-menu-items .remove-creator-menu){color:var(--danger-ink)}
html body .post-menu-items .remove-creator-menu:hover{background:var(--danger-bg);color:var(--danger-ink)}
html dialog::backdrop{background:var(--backdrop)}
html body #toast{background:var(--overlay);color:var(--overlay-ink)}
html body :is(.playback-status,.playback-error){background:var(--paper);color:var(--ink);border:1px solid var(--line)}
html body .save-button,html body .save-button:hover,html body .carousel-controls button{background:var(--paper);color:var(--ink)}
html body :is(.carousel-controls span,.media-tag){background:var(--overlay);color:var(--overlay-ink)}
html body .reel-play{background:var(--paper);color:var(--green);border-color:var(--control-border)}
html body :is(.source-preview,iframe.source-preview){background:var(--paper);border-color:var(--line)}
/* Media pixels, generated cover art, and external iframe documents retain source colors. */
html body input[type=checkbox]:not(.filter-check input,.inline-switch input),html body .filter-check-mark{background:var(--control-bg);border-color:var(--control-border)}
html body input[type=checkbox]:not(.filter-check input,.inline-switch input):checked,html body .filter-check input:checked+.filter-check-mark{background:var(--accent-fill);border-color:var(--accent-fill)}
html body input[type=checkbox]:not(.filter-check input,.inline-switch input):checked:after{border-color:var(--on-accent)}
html body .filter-check input:checked+.filter-check-mark{color:var(--on-accent)}
html body .filter-check input:checked+.filter-check-mark:after{border-color:var(--on-accent)}
html body .filter-check input:focus-visible+.filter-check-mark{outline-color:var(--focus)}
html body .switch-track{background:var(--control-border)}
html body .inline-switch input:checked+.switch-track{background:var(--accent-fill)}
html body .switch-track:after{background:var(--paper)}
html body :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--focus);outline-offset:3px}
html body .inline-switch input:focus-visible+.switch-track{outline-color:var(--focus)}
html body progress,html body progress::-webkit-progress-bar{background:var(--line)}
html body progress::-webkit-progress-value{background:var(--accent-fill)}
html body progress::-moz-progress-bar{background:var(--accent-fill)}
::selection{background:var(--light);color:var(--ink)}
/* The only new layout belongs to the appearance control itself. */
.appearance-settings{border:0;padding:0;margin:0;min-width:0}
.appearance-settings legend{font-size:16px;font-weight:650;padding:0;margin-bottom:4px;color:var(--ink)}
.appearance-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}
.appearance-option{display:block;position:relative;cursor:pointer;min-width:0}
.appearance-option>input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.appearance-choice{position:relative;display:grid;gap:9px;height:100%;padding:20px 16px;border:1px solid var(--control-border);border-radius:12px;background:var(--paper);color:var(--ink)}
.appearance-choice strong{font-size:13px}.appearance-choice small{font-size:12px;line-height:1.5;color:var(--muted)}
.appearance-symbol{font-size:24px;line-height:1.2;color:var(--green)}
.appearance-check{position:absolute;top:16px;right:16px;visibility:hidden;color:var(--green);font-size:16px}
.appearance-option>input:checked+.appearance-choice{background:var(--light);border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}
.appearance-option>input:checked+.appearance-choice .appearance-check{visibility:visible}
.appearance-option>input:focus-visible+.appearance-choice{outline:3px solid var(--focus);outline-offset:3px}
.appearance-option:hover .appearance-choice{border-color:var(--green)}
.appearance-local{margin-bottom:0}
@media(max-width:560px){.appearance-options{grid-template-columns:1fr}.appearance-choice{grid-template-columns:30px 1fr;gap:5px 12px;padding:16px 42px 16px 16px}.appearance-symbol{grid-row:1/3}.appearance-choice small{grid-column:2}.appearance-check{top:17px}}
