/* Browser-only theme preference. Light keeps the existing site palette. */
:root { color-scheme: light; }
/* Account details and connected services. */
html[data-theme="dark"] .user-view .step-block {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .user-view :is(.account-info-label, .account-info-value, .step-block-title, .step-block label) { color: var(--theme-text); }
html[data-theme="dark"] .user-view .account-info-row { border-color: var(--theme-border); }
html[data-theme="dark"] .user-view :is(.account-info-label i, .account-patreon-benefits i) { color: #e4c58c; }
html[data-theme="dark"] .user-view .account-patreon-badge { background: #243b2c; color: #7bdd91; }
html[data-theme="dark"] .user-view .account-patreon-plan { background: #393329; color: #e4c58c; }
html[data-theme="dark"] .user-view .account-patreon-benefits span { background: var(--theme-hover); color: var(--theme-text); }
html[data-theme="dark"] .user-view .card-category { color: var(--theme-muted); }
html[data-theme="dark"] .user-view .builder-btn-primary,
html[data-theme="dark"] .user-view .builder-btn-primary:visited { background: #e4c58c; color: #201a10 !important; }
html[data-theme="dark"] .user-view .builder-btn-primary:hover,
html[data-theme="dark"] .user-view .builder-btn-primary:focus { background: #edcf98; color: #201a10 !important; }
/* CKEditor chrome; editable iframe styles live in ckeditor-theme.css. */
html[data-theme="dark"] :is(.cke_chrome, .cke_top, .cke_bottom, .cke_toolgroup, .cke_combo_button, .cke_panel, .cke_dialog_body, .cke_dialog_title, .cke_dialog_footer) { background: #303741; border-color: #657182; color: #e0e3e8; box-shadow: none; }
html[data-theme="dark"] :is(.cke_combo_text, .cke_button_label, .cke_path_item, .cke_path_empty, .cke_dialog label, .cke_dialog_ui_labeled_label) { color: #e0e3e8; text-shadow: none; }
html[data-theme="dark"] .cke_button_icon { filter: invert(1); }
html[data-theme="dark"] :is(a.cke_button:hover, a.cke_button:focus, a.cke_button_on) { background: #596779; border-color: #c9a96e; }
html[data-theme="dark"] .cke_combo_arrow { border-top-color: #e0e3e8; }
html[data-theme="dark"] :is(.cke_combo_on, .cke_combo_off) .cke_combo_button:hover,
html[data-theme="dark"] .cke_combo_on .cke_combo_button { background: #596779; border-color: #c9a96e; box-shadow: none; }
html[data-theme="dark"] :is(.cke_source, input.cke_dialog_ui_input_text, textarea.cke_dialog_ui_input_textarea, select.cke_dialog_ui_input_select) { background: #252a31; color: #e0e3e8; border-color: #8290a3; }
html[data-theme="dark"] :is(a.cke_dialog_tab, a.cke_dialog_ui_button) { background: #303741; color: #e0e3e8; border-color: #657182; text-shadow: none; }
html[data-theme="dark"] a.cke_dialog_tab_selected { background: #252a31; color: #ffe0a4; }
/* PNJ creation uses the same form blocks as the character builder. */
html[data-theme="dark"] .npc-form .step-block { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .npc-form :is(.step-block-title, .step-block label) { color: var(--theme-text); }
html[data-theme="dark"] .npc-form .form-extra-action { background: #393329; color: #e4c58c; }
html[data-theme="dark"] .npc-form .form-extra-action:hover { background: #4a4030; color: #ffe0a4; }
html[data-theme="dark"] .npc-form :is(.custom-select-trigger, .custom-options) { background: #303741; color: var(--theme-text); border-color: #8290a3; }
html[data-theme="dark"] .npc-form .custom-option { color: var(--theme-text); }
html[data-theme="dark"] .npc-form .custom-option:hover { background: var(--theme-hover); }
html[data-theme="dark"] .npc-form select.form-control { background: #303741; border-color: #8290a3; }
html[data-theme="dark"] .npc-form .alert-warning { background: #393329; color: #ffe0a4; border-color: #8f7447; }
html[data-theme="dark"] .npc-form .alert-info { background: #243641; color: #b8dbff; border-color: #557e99; }
html[data-theme="dark"] .npc-form :is(.alert-warning, .alert-info) p { color: inherit; }
html[data-theme="dark"] .npc-form .has-error .control-label { color: #ff9494; }
html[data-theme="dark"] .npc-form .has-success .control-label { color: #7bdd91; }
html[data-theme="dark"] .campanas-view .step-block {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .campanas-view :is(.step-block label, .step-block-title) { color: var(--theme-text); }
html[data-theme="dark"] .campanas-view legend { color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .campanas-view .input-group-addon { background: var(--theme-hover); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .campanas-view #info_codigo_de_campana code { background: #393329; color: #ffe0a4; }
#navbar .theme-picker { padding: 0 6px; }
#navbar #site-theme {
    color-scheme: dark;
    background: #181c22;
    color: #d7dbe2;
    border: 1px solid #49515d;
    border-radius: 6px;
    padding: 0;
    width: 40px;
    height: 40px;
    font-size: 19px;
    max-width: 100%;
}
#navbar #site-theme:focus-visible { outline: 2px solid #c9a96e; outline-offset: 3px; }

html[data-theme="dark"] {
    color-scheme: dark;
    --theme-bg: #1b1e23;
    --theme-surface: #252a31;
    --theme-hover: #303741;
    --theme-text: #e0e3e8;
    --theme-muted: #adb5c1;
    --theme-border: #454c57;
    --theme-link: #80bfff;
    background: linear-gradient(rgba(27,30,35,.96), rgba(27,30,35,.96)), url('../imagenes/backgrounds/background.jpg') repeat;
    color: var(--theme-text);
}
/* Paint one continuous canvas: body has height: 100% in site.css. */
html[data-theme="dark"] body { background: transparent; color: var(--theme-text); }
html[data-theme="dark"] .fondo { display: none; }
html[data-theme="dark"] .wrap > .container { color: var(--theme-text); }
html[data-theme="dark"] p,
html[data-theme="dark"] span.p,
html[data-theme="dark"] .table,
html[data-theme="dark"] .sim-table,
html[data-theme="dark"] .title,
html[data-theme="dark"] .book-chapter-title a,
html[data-theme="dark"] .book-title,
html[data-theme="dark"] .book-view-title { color: var(--theme-text); }
html[data-theme="dark"] a,
html[data-theme="dark"] a b,
html[data-theme="dark"] .book-sections a,
html[data-theme="dark"] .rule-reader .ref,
html[data-theme="dark"] .ref-link { color: var(--theme-link); }
html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus { color: #b8dbff; }
html[data-theme="dark"] .breadcrumb > .active,
html[data-theme="dark"] .help-block,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .per-page-form span,
html[data-theme="dark"] .book-meta,
html[data-theme="dark"] .book-subtitle,
html[data-theme="dark"] .book-view-meta { color: var(--theme-muted); }
html[data-theme="dark"] .breadcrumb > li + li::before { color: var(--theme-muted); }
html[data-theme="dark"] .per-page-form label { color: var(--theme-text); }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .per-page-form select,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .well,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .book-card,
html[data-theme="dark"] .book-chapters-card,
html[data-theme="dark"] .book-empty {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .form-control::placeholder { color: var(--theme-muted); opacity: 1; }
html[data-theme="dark"] .form-control:focus { border-color: var(--theme-link); box-shadow: 0 0 0 2px rgba(128,191,255,.15); }
html[data-theme="dark"] .btn-default,
html[data-theme="dark"] .view-switch a:not(.active),
html[data-theme="dark"] .pagination > li > a,
html[data-theme="dark"] .pagination > li > span {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .btn-default:hover,
html[data-theme="dark"] .view-switch a:not(.active):hover,
html[data-theme="dark"] .pagination > li:not(.active) > a:hover { background: var(--theme-hover); }
html[data-theme="dark"] .pagination > .active > a,
html[data-theme="dark"] .pagination > .active > span { background: #2869ad; color: #fff; }
html[data-theme="dark"] .pagination > .disabled > a,
html[data-theme="dark"] .pagination > .disabled > span { color: var(--theme-muted); }
html[data-theme="dark"] .table > thead > tr > th,
html[data-theme="dark"] .table > tbody > tr > th,
html[data-theme="dark"] .table > tbody > tr > td,
html[data-theme="dark"] .table > tfoot > tr > td,
html[data-theme="dark"] .sim-table-header,
html[data-theme="dark"] .book-chapter,
html[data-theme="dark"] hr,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color: var(--theme-border); }
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd),
html[data-theme="dark"] .table > tbody > tr.active > td,
html[data-theme="dark"] .panel-default > .panel-heading { background: var(--theme-surface); color: var(--theme-text); }
html[data-theme="dark"] .table-hover > tbody > tr:hover { background: var(--theme-hover); }
html[data-theme="dark"] .book-sidebar a.active-section { background: var(--theme-hover); color: #e4c58c; }
html[data-theme="dark"] .close { color: var(--theme-text); text-shadow: none; opacity: .8; }
html[data-theme="dark"] .modal .modal-header,
html[data-theme="dark"] .modal .modal-header.panel-heading { background: var(--theme-hover); border-color: var(--theme-border); }
html[data-theme="dark"] .modal .modal-title { color: var(--theme-text); }
html[data-theme="dark"] .modal .modal-footer { background: var(--theme-surface); }
html[data-theme="dark"] .modal .close:hover,
html[data-theme="dark"] .modal .close:focus { color: #fff; opacity: 1; }
html[data-theme="dark"] .modal #modal-accept { background: #c9a96e; color: #201a10; }
html[data-theme="dark"] .modal #modal-accept:hover,
html[data-theme="dark"] .modal #modal-accept:focus { background: #edcf98; }
html[data-theme="dark"] .btn-control { color: var(--theme-text); }
html[data-theme="dark"] .title::after,
html[data-theme="dark"] .title::before { background: linear-gradient(to right, rgba(201,169,110,.6), rgba(201,169,110,0)); }
html[data-theme="dark"] .title::before { background: linear-gradient(to left, rgba(201,169,110,.6), rgba(201,169,110,0)); }

@media (max-width: 767px) {
    #navbar .theme-picker { padding: 8px 14px; }
}
@media print {
    html[data-theme="dark"], html[data-theme="dark"] body { background: #fff; color: #222; }
    html[data-theme="dark"] .wrap > .container,
    html[data-theme="dark"] .wrap p,
    html[data-theme="dark"] .wrap .title,
    html[data-theme="dark"] .wrap .table { color: #222; }
    html[data-theme="dark"] .fondo { display: none; }
}
/* Replace dark bitmap rings on utility controls with a visible outline. */
html[data-theme="dark"] .wrap > .container .btn-control,
html[data-theme="dark"] .pagination li a,
html[data-theme="dark"] .pagination li span {
    background-image: none;
    border: 1px solid var(--theme-border) !important;
    border-radius: 50%;
    color: var(--theme-text);
}
html[data-theme="dark"] .wrap > .container .btn-control:hover,
html[data-theme="dark"] .wrap > .container .btn-control:focus { color: #fff; border-color: var(--theme-link) !important; }
html[data-theme="dark"] .book-series { color: var(--theme-muted); }
html[data-theme="dark"] .home-page { color: var(--theme-text); }
html[data-theme="dark"] .home-section-header p,
html[data-theme="dark"] .home-card p { color: var(--theme-muted); }
html[data-theme="dark"] .home-card { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .home-hero-bg .home-search-input.form-control { background: var(--theme-surface); color: var(--theme-text); }

/* Character index: dark surfaces, warm accents and readable card names. */
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-filter-card,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-alert,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-empty,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
    box-shadow: 0 14px 34px rgba(0,0,0,.2);
}
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card-image {
    background: radial-gradient(circle at top, rgba(201,169,110,.16), transparent 65%), #20252c;
}
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card-info h2 { color: var(--theme-text); }
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card:hover,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card:focus-visible { border-color: #c9a96e; }
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card:hover h2,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card:focus-visible h2 { color: #e4c58c; }
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card-meta span,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-sort a,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-empty-icon {
    background: #393329;
    color: #e4c58c;
}
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-sort a:hover,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-sort a:focus-visible { background: #4a4030; color: #ffe0a4; }
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personaje-card-action,
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-alert > i { color: #e4c58c; }
html[data-theme="dark"] :is(.personajes-index-modern, .campanas-view) .personajes-empty p { color: var(--theme-muted); }
html[data-theme="dark"] :is(:is(.personajes-index-modern, .campanas-view), :is(.personajes-main, .personaje-create-layout)) .builder-btn-primary,
html[data-theme="dark"] :is(:is(.personajes-index-modern, .campanas-view), :is(.personajes-main, .personaje-create-layout)) .builder-btn-primary:visited {
    background: linear-gradient(135deg, #d0a65d, #e4c58c);
    color: #201a10 !important;
}
html[data-theme="dark"] :is(:is(.personajes-index-modern, .campanas-view), :is(.personajes-main, .personaje-create-layout)) .builder-btn-primary:hover,
html[data-theme="dark"] :is(:is(.personajes-index-modern, .campanas-view), :is(.personajes-main, .personaje-create-layout)) .builder-btn-primary:focus { color: #201a10 !important; background: #edcf98; }
html[data-theme="dark"] :is(:is(.personajes-index-modern, .campanas-view), :is(.personajes-main, .personaje-create-layout)) .builder-btn-secondary,
html[data-theme="dark"] :is(:is(.personajes-index-modern, .campanas-view), :is(.personajes-main, .personaje-create-layout)) .builder-btn-outline {
    background: var(--theme-surface);
    color: #e4c58c;
    border-color: #726044;
}
html[data-theme="dark"] :is(:is(.personajes-index-modern, .campanas-view), :is(.personajes-main, .personaje-create-layout)) .builder-btn-secondary:hover,
html[data-theme="dark"] :is(:is(.personajes-index-modern, .campanas-view), :is(.personajes-main, .personaje-create-layout)) .builder-btn-outline:hover { background: var(--theme-hover); color: #ffe0a4; }

/* Class and race catalog cards share the character index palette. */
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
    box-shadow: 0 14px 34px rgba(0,0,0,.2);
}
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card-image {
    background: radial-gradient(circle at top, rgba(201,169,110,.16), transparent 65%), #20252c;
}
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card-header h3 { color: var(--theme-text); }
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card-text { color: var(--theme-muted); }
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card-header span,
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .personaje-card-action { color: #e4c58c; }
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card-stats span {
    background: #393329;
    color: #e4c58c;
}
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card:hover,
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card:focus-visible { border-color: #c9a96e; }
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card:hover h3,
html[data-theme="dark"] :is(.clases-index, .razas-index, .personaje-create-layout) .race-card:focus-visible h3 { color: #e4c58c; }

/* The printed white character sheets keep black ink in either theme.
   Inline green/red modifiers retain their existing semantic colors. */
html[data-theme="dark"] :is(#hoja-personaje1, #hoja-personaje2) {
    color-scheme: light;
    color: #333;
}
html[data-theme="dark"] :is(#hoja-personaje1, #hoja-personaje2) :is(.tag-hoja, .tag-num, p, span.p, a, a b, .table, .sim-table) {
    color: #333;
}

/* Web character tabs; printed sheet IDs keep their separate ink rules. */
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) :is(.step-block, .ability-card, .combat-stat-card, .character-info-item, .decision-history-card, .empty-decision-tree, .favorite-choice-card, .decision-info, .level-up-summary > div, .input-group-addon) {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
    box-shadow: 0 10px 26px rgba(0,0,0,.18);
}
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) :is(.ability-stats > div, .character-portrait-frame) {
    background: var(--theme-hover);
    border-color: var(--theme-border);
    box-shadow: none;
}
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) :is(.step-block label, .step-block-title, .character-info-item strong, .combat-stat-value, .combat-stat-breakdown-total, .skills-points-content strong) { color: var(--theme-text); }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) :is(.character-profile-summary p, .character-info-item small, .ability-stats span, .ability-extras, .combat-stat-formula, .combat-stat-breakdown, .combat-note, .combat-weapon-info dt, .skills-points-content span, .decision-help) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) :is(.character-kicker, .character-info-item > span, .ability-card-header div > span, .combat-stat-header, .combat-stat-icon, .combat-stat-breakdown summary, .skills-points-icon, .decision-history-icon, .favorite-choice-icon, .level-up-card-icon, .form-extra-action) { color: #e4c58c; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) :is(.ability-extras, .combat-stat-breakdown, .combat-stat-breakdown-row, .favorite-choice-row) { border-color: var(--theme-border); }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .stat-positive { color: #7bdd91; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .stat-negative { color: #ff9494; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) :is(.ability-roll-btn, .combat-roll-btn) { color: #e4c58c !important; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .personaje-view-menu.step-indicator li a {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .personaje-view-menu.step-indicator li.active a,
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .personaje-view-menu.step-indicator li a:hover { background: var(--theme-hover); border-color: #c9a96e; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .personaje-view-menu.step-indicator :is(.caption, .step) { color: #e4c58c; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .personaje-view-menu.step-indicator li:not(.active) .step { background: #393329; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .personaje-view-menu.step-indicator li.active .step { color: #fff; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .decision-badge.pending { color: #f2ce83; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .decision-badge.ready { color: #7bdd91; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .favorite-choice-card:has(input:checked) { background: #393329; border-color: #c9a96e; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) :is(.custom-select-trigger, .custom-options, .pj-loading-box) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .custom-option { color: var(--theme-text); }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .custom-option:hover { background: var(--theme-hover); }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .text-success { color: #7bdd91; }
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .text-danger { color: #ff9494; }

/* The parchment stat block keeps the light palette in both themes. */
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .npc-statblock {
    color-scheme: light;
    color: #333;
}
html[data-theme="dark"] :is(.personajes-main, .personaje-create-layout) .npc-statblock :is(p, a, a b, span.p, .table, .sim-table) { color: #333; }
/* Public-page audit: forum discussions and illustrated home cards. */
html[data-theme="dark"] :is(.forum-post, .forum-reply-form-box, .forum-login-required, .forum-group-card, .forum-related-box, .forum-related-object-box) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.forum-post-username, .forum-post-name, .forum-post-body, .forum-group-card-title, .forum-group-value, .forum-related-title, .timeline-count, .empty-title) { color: var(--theme-text); }
html[data-theme="dark"] :is(.forum-post-date, .forum-post-meta, .forum-time-separator, .forum-empty-state, .login-text, .forum-group-label, .forum-related-empty, .forum-related-object-label, .timeline-current-date, .timeline-bottom-date, .timeline-current-top, .forum-action-count) { color: var(--theme-muted); }
html[data-theme="dark"] .forum-post :is(.post-action, .forum-action) { color: var(--theme-muted); }
html[data-theme="dark"] .forum-post :is(.post-action, .forum-action):hover { background: var(--theme-hover); color: var(--theme-text); }
html[data-theme="dark"] .forum-post .post-action.is-liked { color: #ff9494; }
html[data-theme="dark"] .forum-post.highlight { background: #393329; }
html[data-theme="dark"] .forum-related-item a { color: var(--theme-link); }
html[data-theme="dark"] .home-page .home-hub-card { background: var(--theme-surface); color: var(--theme-text); }
html[data-theme="dark"] .home-page .home-hub-card::before { opacity: .18; }
html[data-theme="dark"] .home-page .home-hub-card.active { background: var(--theme-hover); border-color: #c9a96e; }
html[data-theme="dark"] .home-page :is(.home-book-card, .home-book-card:hover) { color: var(--theme-text); }
html[data-theme="dark"] .home-page .home-news-content p { color: var(--theme-muted); }
html[data-theme="dark"] .home-page :is(.home-news-date, .home-news-more) { color: #e4c58c; }
html[data-theme="dark"] .home-page .home-news-item { border-color: var(--theme-border); }
html[data-theme="dark"] .has-error .help-block { color: #ff9494; }
html[data-theme="dark"] .busqueda { color: #24200f; }
html[data-theme="dark"] .forum-solution-title { color: #7bdd91; }
.mobile-theme-picker { display: flex; gap: 16px; align-items: center; padding: 14px 20px; color: #d7dbe2; }
.mobile-theme-picker label { margin: 0; }
#site-theme-mobile { color-scheme: dark; background: #181c22; color: #d7dbe2; border: 1px solid #49515d; border-radius: 6px; padding: 0; width: 40px; height: 40px; font-size: 19px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
#navbar #site-theme:hover, #site-theme-mobile:hover { background: #303741; color: #ffe0a4; border-color: #c9a96e; }
#site-theme-mobile:focus-visible { outline: 2px solid #c9a96e; outline-offset: 3px; }

/* Character creation, including the steps loaded asynchronously. */
html[data-theme="dark"] #pj-loading-screen { background: var(--theme-bg); }
html[data-theme="dark"] #pj-loading-screen::before { opacity: .06; }
html[data-theme="dark"] #pj-loading-screen .pj-loading-box { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .personaje-create-layout :is(.card-compra, .generation-methods > li > a, .checkbox-group .list-group-item, .builder-sidebar-steps .step-indicator li a) {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .personaje-create-layout .generation-methods > li > a { border-color: var(--theme-border) !important; }
html[data-theme="dark"] .personaje-create-layout .generation-methods > li.active > a,
html[data-theme="dark"] .personaje-create-layout .generation-methods > li > a:hover,
html[data-theme="dark"] .personaje-create-layout .generation-methods > li > a:focus-visible {
    background: var(--theme-hover);
    color: var(--theme-text);
    border-color: #c9a96e !important;
}
html[data-theme="dark"] .personaje-create-layout :is(.wizard-rule-help strong, .card-compra h3, .card-compra p b, .card-compra .c-label, .checkbox-group .label-tab, .builder-sidebar-steps .caption, .character-roll-table .table thead th, .character-roll-table .table .num) { color: var(--theme-text); }
html[data-theme="dark"] .personaje-create-layout :is(.wizard-rule-help p, .generation-methods > li > a span, .card-compra h3 + p, .race-extra-bonus label) { color: var(--theme-muted); }
html[data-theme="dark"] .personaje-create-layout :is(.wizard-rule-help > i, .wizard-rule-help a, .race-card-actions a) { color: #e4c58c; }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step { background: #393329; color: #e4c58c; }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step-indicator li:is(.active, .current) a { background: var(--theme-hover); border-color: #c9a96e; }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step-indicator li:is(.active, .current, .complete) .step { color: #fff; }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step-indicator li.complete a { background: #24332b; border-color: #568867; }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step-indicator li.complete .caption { color: #7bdd91; }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step-indicator li:is(.active, .current) .step { background: linear-gradient(135deg, #9a6a22, #c79b4d); }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step-indicator li.complete { opacity: .85; }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step-indicator li.complete.active { opacity: 1; }
html[data-theme="dark"] .personaje-create-layout .builder-sidebar-steps .step-indicator li.complete .step { background: #2e7d32; }
html[data-theme="dark"] .personaje-create-layout .character-roll-table.table-responsive > .table tbody td { background: var(--theme-surface); border-color: var(--theme-border) !important; }
html[data-theme="dark"] .personaje-create-layout .character-roll-table.table-responsive > .table .numt { color: #7bdd91; }
html[data-theme="dark"] .personaje-create-layout .character-roll-table.table-responsive > .table select.form-control {
    background: #353e4b;
    color: #f1f4f8;
    border: 1px solid #8290a3;
}
html[data-theme="dark"] .personaje-create-layout .character-roll-table.table-responsive > .table select.form-control:hover { border-color: #b1becf; }
html[data-theme="dark"] .personaje-create-layout .character-roll-table.table-responsive > .table select.form-control:focus {
    border-color: #80bfff;
    box-shadow: 0 0 0 3px rgba(128,191,255,.25);
}
html[data-theme="dark"] .personaje-create-layout .race-card.selected { border-color: #c9a96e; box-shadow: 0 0 0 3px rgba(201,169,110,.25); }
html[data-theme="dark"] .personaje-create-layout .skill-step-table tbody td { background: var(--theme-surface); border-color: var(--theme-border) !important; }
html[data-theme="dark"] .personaje-create-layout .skill-step-table tbody tr:hover td { background: var(--theme-hover); }
html[data-theme="dark"] .personaje-create-layout :is(.skill-step-table thead th, .skill-step-table .b, .skill-step-table .ck label, .skill-step-table #total b span:first-child, .personajes-create-continue p, .personajes-create-continue label) { color: var(--theme-text); }
html[data-theme="dark"] .personaje-create-layout .skill-step-table .fa-check { color: #7bdd91; }
html[data-theme="dark"] .personaje-create-layout .skill-step-table .fa-asterisk { color: #e4c58c; }
html[data-theme="dark"] .personaje-create-layout .personajes-create-continue .continue { background: var(--theme-surface); border-color: var(--theme-border); }
