/* RTM Cloud uses the active RTM palette, including dark/high-contrast themes. */
.maer-settings { --maer-text:var(--text); --maer-muted:var(--muted); color:var(--text); background:var(--panel); }
.maer-settings .panel-head { color:var(--text); background:var(--panel); align-items:flex-start; gap:18px; }
.maer-settings .panel-head p { color:var(--muted); margin:8px 0 0; font-size:14px; }
.maer-settings form, .maer-state-card { margin:20px; }
.maer-settings fieldset { border:1px solid var(--line); border-radius:10px; padding:20px; display:grid; gap:16px; min-width:0; }
.maer-settings legend, .maer-settings h3 { color:var(--text); font-weight:750; }
.maer-settings label { display:grid; gap:7px; color:var(--text); font-size:14px; }
.maer-settings input:not([type=checkbox]), .maer-settings select, .maer-settings textarea { box-sizing:border-box; width:100%; max-width:100%; border:1px solid var(--field-border); background:var(--field-bg); color:var(--input-text); padding:10px 12px; border-radius:7px; min-height:42px; color-scheme:inherit; }
.maer-settings .maer-checkbox { display:flex; gap:10px; align-items:center; }
.maer-settings .maer-checkbox input { width:18px; height:18px; margin:0; accent-color:var(--accent); }
.maer-settings .maer-help { color:var(--muted); font-size:13px; line-height:1.55; margin:0; }
.maer-settings summary { color:var(--accent); cursor:pointer; font-weight:600; }
.maer-settings details[open] { display:grid; gap:12px; }
.maer-settings details[open] > * { margin-top:12px; }
.maer-settings .maer-actions { display:flex; flex-wrap:wrap; gap:12px; margin:18px 0 12px; }
.maer-settings .btn { background:var(--button-bg); color:var(--text); border-color:var(--field-border); }
.maer-settings .btn.primary { background:var(--accent-strong); color:var(--accent-contrast); border-color:var(--accent-border); }
.maer-settings :is(input,select,textarea,button,summary):focus-visible { outline:3px solid var(--field-focus); outline-offset:3px; }
.maer-settings :disabled { opacity:.65; cursor:not-allowed; }
.maer-settings [hidden] { display:none!important; }
#maerNotice { margin:20px; padding:14px; background:var(--accent-soft); color:var(--text); border:1px solid var(--accent-border); border-radius:8px; line-height:1.5; }
#maerNotice[data-error=true] { background:var(--panel-2); color:var(--danger); border-color:var(--danger); }
.maer-settings dl { display:grid; grid-template-columns:180px minmax(0,1fr); gap:10px 16px; line-height:1.5; }
.maer-settings dt { color:var(--muted); }
.maer-settings dd { margin:0; color:var(--text); overflow-wrap:anywhere; }
@media(max-width:640px) { .maer-settings .panel-head { flex-direction:column; }.maer-settings form,.maer-state-card,#maerNotice { margin:14px; }.maer-settings fieldset { padding:14px; }.maer-settings dl { grid-template-columns:1fr; gap:3px; }.maer-settings dd { margin-bottom:10px; } }

/* Match older settings-page specificity while keeping the theme's field tokens. */
:root body.settings-page .config-section.maer-settings { background:var(--panel); color:var(--text); }
:root[data-theme] body.settings-page .config-section.maer-settings :is(h2,h3,label,legend,dd) { color:var(--text)!important; }
:root body.settings-page .maer-settings :is(dt,.maer-help) { color:var(--muted); }
:root body.settings-page .config-content:has(.maer-settings.active)::before { display:none; }
:root[data-theme] body.settings-page .maer-settings :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]),select,textarea) { background:var(--field-bg)!important; color:var(--input-text)!important; border-color:var(--field-border)!important; }
