/* R.ai · warm dark palette. Applies only when the selected theme is dark. */
html[data-theme="dark"] {
 color-scheme: dark;
 --paper:#1e1917;
 --ivory:#29211e;
 --ink:#f7eee8;
 --muted:#cab7ab;
 --line:#59473e;
 --forest:#c5ada0;
 --brick:#f39a81;
 --amber:#ffd488;
 --action:#a53f28;
 --action-hover:#b54a31;
 --rai-dark-panel:#251e1b;
 --rai-dark-input:#181412;
 --rai-dark-field-line:#927669;
 --rai-dark-link:#ffae96;
 --rai-dark-focus:#ffd488;
 --rai-dark-selected:#442b24;
 --rai-dark-error:#ffc7ba;
 --rai-dark-error-bg:#411f19;
}
html[data-theme="dark"] body { background:var(--paper); color:var(--ink) }
html[data-theme="dark"] header,
html[data-theme="dark"] footer { background:var(--ivory); border-color:var(--line) }
html[data-theme="dark"] .brand {
 background:#f4efe5;
 border-radius:8px;
 padding:4px 6px;
}
html[data-theme="dark"] :is(.panel,.legal-document,.document,.idbar,dialog) {
 background:var(--rai-dark-panel);
 color:var(--ink);
 border-color:var(--line);
}
html[data-theme="dark"] :is(.tinted,.notice,.status,.optional-onboarding,.preview-entry) {
 background:var(--rai-dark-selected);
 color:var(--ink);
 border-color:#825949;
}
html[data-theme="dark"] :is(.error,.is-error,[role="alert"].notice) {
 background:var(--rai-dark-error-bg);
 color:var(--rai-dark-error);
 border-color:#d97d67;
}
html[data-theme="dark"] :is(.skip:focus,code,kbd,samp) {
 background:#352923;
 color:#ffdbc7;
 border-radius:4px;
}
html[data-theme="dark"] a:not(.brand):not(.button):not(.small-btn),
html[data-theme="dark"] .linkbutton,
html[data-theme="dark"] .optional-label {
 color:var(--rai-dark-link);
}
html[data-theme="dark"] :is(a,button,input,select,textarea,summary):focus-visible,
html[data-theme="dark"] .toggle .option input:focus-visible + span {
 outline:3px solid var(--rai-dark-focus);
 outline-offset:3px;
}
html[data-theme="dark"] :is(.button,button,.small-btn) {
 color:#fff5ef;
 background:var(--action);
 border-color:var(--action);
}
html[data-theme="dark"] :is(.button,button,.small-btn):hover {
 background:var(--action-hover);
 color:#fff;
 border-color:var(--action-hover);
}
html[data-theme="dark"] :is(.button.secondary,button.secondary,.linkbutton,.optional-onboarding form button) {
 color:var(--rai-dark-link);
 border-color:#a97663;
 background:transparent;
}
html[data-theme="dark"] :is(.linkbutton,.optional-onboarding form button) { border-color:transparent }
html[data-theme="dark"] :is(.button.secondary,button.secondary,.linkbutton,.optional-onboarding form button):hover {
 color:#fff5ef;
 background:var(--rai-dark-selected);
 border-color:#ce967e;
}
html[data-theme="dark"] :is(button,.button)[aria-disabled="true"],
html[data-theme="dark"] :is(button,input,select,textarea):disabled {
 background:#302724;
 color:#bdaba0;
 border-color:#664e43;
 cursor:not-allowed;
}
html[data-theme="dark"] :is(input:not([type="radio"]):not([type="checkbox"]),select,textarea) {
 background:var(--rai-dark-input);
 color:var(--ink);
 border-color:var(--rai-dark-field-line);
}
html[data-theme="dark"] :is(input,textarea)::placeholder { color:#b59f92; opacity:1 }
html[data-theme="dark"] option { color:var(--ink); background:var(--rai-dark-input) }
html[data-theme="dark"] .option input { accent-color:#de8067 }
html[data-theme="dark"] :is(td,th,dt,dd,hr) { border-color:var(--line) }
html[data-theme="dark"] th { background:var(--ivory); color:var(--ink) }
html[data-theme="dark"] .toggle .options,
html[data-theme="dark"] .toggle .option + .option { border-color:var(--rai-dark-field-line) }
html[data-theme="dark"] .toggle .option span { color:var(--ink) }
html[data-theme="dark"] .toggle .option input:checked + span {
 background:var(--action);
 color:#fff;
}
html[data-theme="dark"] .language-picker { background:#342822; border-color:#77574a }
html[data-theme="dark"] .language-picker [aria-current] { background:var(--action); color:#fff }
html[data-theme="dark"] .slide-links a { color:var(--rai-dark-link); border-color:#a97663 }
html[data-theme="dark"] .slide-links a[aria-current] { color:#fff; border-color:#d98a74; background:var(--action) }
html[data-theme="dark"] .scene { background:#2d221d; color:#fff5ef }
html[data-theme="dark"] .scene-caption { background:linear-gradient(transparent,#1e1412f2) }
html[data-theme="dark"] .action-loading { color:var(--rai-dark-link) }
html[data-theme="dark"] .action-loading::before { border-color:#684739; border-top-color:#ffae96 }
html[data-theme="dark"] .demo-notice { background:#352420; color:var(--ink) }
html[data-theme="dark"] ::selection { color:#201512; background:#ffb39d }
/* Give field and table boundaries readable contrast, including disabled controls. */
html[data-theme="dark"] { --line: #8b766b; }
html[data-theme="dark"] :is(input,select,textarea):disabled {
 background:#302724;
 color:#bdaba0;
 border-color:#927669;
}
html[data-theme="dark"] :is(.notice,.status,.optional-onboarding,.preview-entry) { border-color:#a78576; }
