/* Shared action-button states. Legacy focus gradients must not hide labels. */
html body .btn.btn:is(.btn-primary, .btn-theme, .btn-outline-primary, .btn-outline-theme, .btn-secondary, .btn-outline-secondary, .btn-success, .btn-outline-success, .btn-info, .btn-outline-info, .btn-warning, .btn-outline-warning, .btn-danger, .btn-outline-danger, .btn-light, .btn-dark, .btn-outline-dark) {
    background-image: none !important;
    --action-color: #7367f0;
    --action-soft: #f0edff;
    --action-ink: #fff;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
html body .btn.btn:is(.btn-primary, .btn-theme, .btn-outline-primary, .btn-outline-theme) { --action-hover: #685dd8; }
/*
 * Secondary actions are used for Back, Reset and Cancel throughout the app.
 * Bootstrap's legacy secondary state is dark grey, so define every base and
 * interaction colour here instead of allowing that fallback to leak through.
 */
html body .btn.btn:is(.btn-secondary, .btn-outline-secondary, .btn-light) {
    --action-color: #7367f0;
    --action-hover: #685dd8;
    --action-soft: #f0edff;
    --action-border: #ded8fb;
}
html body .btn.btn:is(.btn-secondary, .btn-light) {
    background-color: var(--action-soft) !important;
    border-color: var(--action-border) !important;
    color: var(--action-color) !important;
    box-shadow: none !important;
}
html body .btn.btn:is(.btn-success, .btn-outline-success) { --action-color: #147a52; --action-hover: #116b47; --action-soft: #e8f6ef; }
html body .btn.btn:is(.btn-info, .btn-outline-info) { --action-color: #186896; --action-hover: #155d86; --action-soft: #eaf4fc; }
html body .btn.btn:is(.btn-warning, .btn-outline-warning) { --action-color: #8a5b05; --action-hover: #7b5104; --action-soft: #fff6dc; }
html body .btn.btn:is(.btn-danger, .btn-outline-danger) { --action-color: #bf3651; --action-hover: #aa3049; --action-soft: #fff0f3; }
html body .btn.btn:is(.btn-dark, .btn-outline-dark) { --action-color: #30384b; --action-hover: #252b3a; --action-soft: #edf0f4; }
html body .btn.btn[class*="btn-inverse-"] { background-image: none !important; --action-color: #7367f0; --action-ink: #fff; }
html body .btn.btn:is(.btn-inverse-primary, .btn-inverse-theme) { --action-hover: #685dd8; }
html body .btn.btn.btn-inverse-danger { --action-color: #bf3651; }
html body .btn.btn.btn-inverse-success { --action-color: #147a52; }
html body .btn.btn.btn-inverse-info { --action-color: #186896; }
html body .btn.btn.btn-inverse-warning { --action-color: #8a5b05; }
html body .btn.btn:is(.btn-inverse-secondary, .btn-inverse-light) { --action-color: #7367f0; --action-hover: #685dd8; }
html body .btn.btn.btn-inverse-dark { --action-color: #30384b; --action-hover: #252b3a; }
html body .btn.btn[class*="btn-inverse-"]:is(:hover, :focus, :active, .active, [aria-pressed="true"]):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
    background-color: var(--action-hover, var(--action-color)) !important;
    border-color: var(--action-hover, var(--action-color)) !important;
    color: var(--action-ink) !important;
    box-shadow: none !important;
}
html body .btn.btn.btn-link:is(:hover, :focus, :active, .active) { background-image: none !important; background-color: #f0edff !important; color: #7367f0 !important; box-shadow: none !important; }

html body .btn.btn:is(.btn-outline-primary, .btn-outline-theme, .btn-outline-secondary, .btn-outline-success, .btn-outline-info, .btn-outline-warning, .btn-outline-danger, .btn-outline-dark) {
    background-color: #fff !important;
    color: var(--action-color) !important;
    border-color: var(--action-color) !important;
    box-shadow: none !important;
}
html body .btn.btn:is(.btn-outline-primary, .btn-outline-theme, .btn-outline-secondary, .btn-outline-success, .btn-outline-info, .btn-outline-warning, .btn-outline-danger, .btn-outline-dark):is(:hover, :focus):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
    background-color: var(--action-soft) !important;
    color: var(--action-color) !important;
    border-color: var(--action-color) !important;
    box-shadow: none !important;
}
html body .btn.btn:is(.btn-primary, .btn-theme, .btn-secondary, .btn-success, .btn-info, .btn-warning, .btn-danger, .btn-light, .btn-dark):is(:hover, :focus):not(:disabled):not(.disabled):not([aria-disabled="true"]),
html body .btn.btn:is(.btn-primary, .btn-theme, .btn-outline-primary, .btn-outline-theme, .btn-secondary, .btn-outline-secondary, .btn-success, .btn-outline-success, .btn-info, .btn-outline-info, .btn-warning, .btn-outline-warning, .btn-danger, .btn-outline-danger, .btn-light, .btn-dark, .btn-outline-dark):is(:active, .active, [aria-pressed="true"]):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
    background-color: var(--action-hover, var(--action-color)) !important;
    border-color: var(--action-hover, var(--action-color)) !important;
    color: var(--action-ink) !important;
    box-shadow: 0 2px 5px rgba(38, 32, 62, .14) !important;
}
/* Bootstrap applies separate grey rules to open dropdowns and checked toggles. */
html body .show > .btn.btn-secondary.dropdown-toggle,
html body .btn-check:checked + .btn.btn-secondary,
html body .btn-check:active + .btn.btn-secondary {
    background-color: var(--action-hover, #685dd8) !important;
    border-color: var(--action-hover, #685dd8) !important;
    color: #fff !important;
    box-shadow: 0 2px 5px rgba(38, 32, 62, .14) !important;
}
/* Keyboard focus remains visible without the old oversized glowing shadow. */
html body .btn.btn:focus-visible { outline: 2px solid #7367f0 !important; outline-offset: 3px; }
html body .btn.btn:is(:disabled, .disabled, [aria-disabled="true"]) { box-shadow: none !important; cursor: not-allowed; opacity: .6; }
/* Icons and nested labels follow the state color rather than retaining a stale theme color. */
html body .btn.btn:is(:hover, :focus, :active, .active, [aria-pressed="true"]) > :is(i, span):not(.badge):not(.spinner-border) { color: inherit !important; }
@media (prefers-reduced-motion: reduce) { html body .btn.btn { transition: none !important; } }
