/* Popup roots live outside main.tt-wiz. Keep these values identical to the skin. */
:root {
    --ttp-elev-1: 0 1px 1px rgba(16,24,40,.04),0 2px 6px -1px rgba(16,24,40,.05);
    --ttp-elev-2: 0 1px 2px rgba(16,24,40,.06),0 6px 14px -3px rgba(16,24,40,.08);
    --ttp-elev-4: 0 3px 6px rgba(16,24,40,.07),0 28px 48px -16px rgba(16,24,40,.16);
    --ttp-edge-lit: #f1f3f5;
    --rc-ties-bg: #dff5e8; --rc-ties-fg: #0b6b3a; --rc-ties-bd: #b9e6c9;
    --rc-expl-bg: #e3eefb; --rc-expl-fg: #1c4e9c; --rc-expl-bd: #bfd6f5;
    --rc-mis-bg: #fde8e8; --rc-mis-fg: #a61b1b; --rc-mis-bd: #f5bcbc;
    --rc-drift-bg: #fff1db; --rc-drift-fg: #8a5300; --rc-drift-bd: #f5d79a;
    --rc-unv-bg: #fff7e6; --rc-unv-fg: #7c4a03; --rc-unv-bd: #f5d79a;
    --rc-pend-bg: #eef0f3; --rc-pend-fg: #5b6470; --rc-pend-bd: #d9dee5;
}

/* Inline caller colours retain precedence over the ordinary confirmation fill. */
.swal2-container.swal2-backdrop-show { background: rgba(16,24,40,.45); }
.swal2-popup { background: #fff; color: #1a1a1a; border: 1px solid #e5e7eb; border-top-color: var(--ttp-edge-lit); border-radius: .75rem; box-shadow: var(--ttp-elev-4); padding: 1.5rem; font-family: "Segoe UI", system-ui, sans-serif; }
.swal2-title { color: #1a1a1a; font-size: 1.1rem; font-weight: 700; padding: 0; }
.swal2-html-container { color: #374151; font-size: .9rem; line-height: 1.6; text-align: left; overflow-wrap: anywhere; }
/* Prose measure only for plain text popups: wide dialogs (money dialog, batch summaries with a set width) keep their full body for tables. */
.swal2-popup:not(.tt-money-dialog):not([style*="width"]) .swal2-html-container { max-width: 65ch; margin-inline: auto; }
.swal2-actions { gap: .5rem; }
.swal2-actions :is(.swal2-styled, .tes-swal-confirm, .tes-swal-cancel) { margin: 0; border: 1px solid transparent; border-radius: .5rem; padding: .6rem 1.1rem; min-height: 2.5rem; font-size: .9rem; font-weight: 600; box-shadow: none; transition: transform 90ms cubic-bezier(.16,1,.3,1); }
.swal2-actions .swal2-confirm:not(.btn-dark):not([style*="background-color"]), .tes-swal-confirm:not([style*="background-color"]) { background-color: #00d639; color: #1a1a1a; }
.swal2-actions .swal2-confirm:not(.btn-dark):not([style*="background-color"]):hover, .tes-swal-confirm:not([style*="background-color"]):hover { background-color: #00b32f; color: #1a1a1a; }
.swal2-actions :is(.swal2-cancel, .swal2-deny):not([style*="background-color"]), .tes-swal-cancel:not([style*="background-color"]) { background-color: #fff; border-color: #d1d5db; color: #374151; }
.swal2-actions :is(.swal2-cancel, .swal2-deny):not([style*="background-color"]):hover, .tes-swal-cancel:not([style*="background-color"]):hover { background-color: #f9fafb; color: #374151; }
.swal2-actions .swal2-confirm:is(.tes-swal-confirm--danger, .btn-danger):not([style*="background-color"]) { background-color: #dc3545; color: #fff; }
.swal2-actions .swal2-confirm:is(.tes-swal-confirm--danger, .btn-danger):not([style*="background-color"]):hover { background-color: #bb2d3b; color: #fff; }
.swal2-actions :is(.swal2-confirm, .swal2-cancel, .swal2-deny)[style*="background-color"] { color: #fff; border-color: transparent; }
.swal2-actions button:active { transform: translateY(1px) scale(.985); }
.swal2-popup :is(button, input, select, textarea):focus-visible { outline: 2px solid #00d639; outline-offset: 2px; box-shadow: none; }
.swal2-icon.swal2-success { color: var(--rc-ties-fg); border-color: #00d639; }
.swal2-icon.swal2-success .swal2-success-ring { border-color: var(--rc-ties-bd); }
.swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: #00d639; }
.swal2-icon.swal2-warning { color: var(--rc-drift-fg); border-color: var(--rc-drift-bd); }
.swal2-icon.swal2-error { color: var(--rc-mis-fg); border-color: var(--rc-mis-bd); }
.swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--rc-mis-fg); }
.swal2-icon.swal2-info { color: var(--rc-expl-fg); border-color: var(--rc-expl-bd); }
.swal2-icon.swal2-question { color: #374151; border-color: var(--rc-pend-bd); }
.swal2-popup :is(.swal2-input, .swal2-select, .swal2-textarea) { border: 1px solid #d1d5db; border-radius: .5rem; background: #fff; color: #1a1a1a; font-size: .9rem; box-shadow: none; max-width: 100%; }
.swal2-popup :is(input, textarea)::placeholder { color: #6b7280; }
.swal2-validation-message { background: #fff; border: 2px solid #fecaca; border-radius: .75rem; color: #374151; font-size: .86rem; }
.swal2-validation-message::before { background: var(--rc-mis-fg); }

.modal-content { background: #fff; color: #1a1a1a; border: 1px solid #e5e7eb; border-top-color: var(--ttp-edge-lit); border-radius: .75rem; box-shadow: var(--ttp-elev-4); }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid #e5e7eb; }
.modal-header .modal-title { color: #1a1a1a; font-size: 1.1rem; font-weight: 700; }
.modal-header .btn-close { width: 2rem; height: 2rem; padding: 0; flex-shrink: 0; }
.modal-body { padding: 1.5rem; color: #374151; font-size: .9rem; }
.modal-footer { padding: .75rem 1.25rem; background: #f9fafb; border-top: 1px solid #e5e7eb; justify-content: flex-end; gap: .5rem; border-radius: 0 0 .75rem .75rem; }
.modal-footer > * { margin: 0; }
.modal-content :is(.btn-primary, .btn-success) { background: #00d639; border-color: #00d639; color: #1a1a1a; }
.modal-content :is(.btn-primary, .btn-success):hover { background: #00b32f; border-color: #00b32f; color: #1a1a1a; }
.modal-content :is(.btn-secondary, .btn-outline-secondary) { background: #fff; border-color: #d1d5db; color: #374151; }
.modal-content .btn { min-height: 2.5rem; border-radius: .5rem; }
.modal-content .btn-danger { background: #dc3545; border-color: #dc3545; color: #fff; }
.modal-content :is(.form-control, .form-select) { border: 1px solid #d1d5db; border-radius: .5rem; }
.modal-content :is(.btn, .btn-close, .form-control, .form-select):focus-visible { outline: 2px solid #00d639; outline-offset: 2px; box-shadow: none; }
.tes-shell #mv-confirm-modal :is(.modal-header, .modal-footer) { padding: 1rem 1.25rem !important; }

.tes-shell .offcanvas, .tes-auth .offcanvas { background: #fff; color: #1a1a1a; box-shadow: var(--ttp-elev-4); }
.tes-shell .offcanvas-header, .tes-auth .offcanvas-header { background: #1a1a1a; color: #fff; padding: .75rem 1rem; }
.tes-shell .offcanvas-header .offcanvas-title, .tes-auth .offcanvas-header .offcanvas-title { color: #00d639; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tes-shell .offcanvas-header .text-muted, .tes-auth .offcanvas-header .text-muted { color: #cbd0d6 !important; }
.tes-shell .offcanvas-header .btn-close, .tes-auth .offcanvas-header .btn-close { filter: invert(1); width: 2rem; height: 2rem; padding: 0; }
.tes-shell .offcanvas-body, .tes-auth .offcanvas-body { background: #fff; }

/* Bootstrap's text-bg and border-0 utilities use !important. */
.tes-shell #mv-toast-container .toast { background: #fff !important; color: #1a1a1a !important; border: 2px solid var(--rc-pend-bd) !important; border-radius: .75rem; box-shadow: var(--ttp-elev-4); max-width: calc(100vw - 2rem); }
.tes-shell #mv-toast-container .toast.text-bg-success { border-color: #00d639 !important; }
.tes-shell #mv-toast-container .toast.text-bg-danger { border-color: #fecaca !important; }
.tes-shell #mv-toast-container .toast.text-bg-warning { border-color: #fcd34d !important; }
.tes-shell #mv-toast-container .toast.text-bg-info { border-color: var(--rc-expl-bd) !important; }
.tes-shell #mv-toast-container .toast .btn-close-white { filter: none !important; width: 2rem; height: 2rem; flex-shrink: 0; padding: 0; }
.tooltip { --bs-tooltip-bg: #1a1a1a; --bs-tooltip-color: #fff; --bs-tooltip-opacity: 1; }
.tooltip .tooltip-inner { background: #1a1a1a; color: #fff; font-size: .78rem; border-radius: .4rem; }

.tes-shell :is(.dropdown-menu, .select2-dropdown), .tes-auth :is(.dropdown-menu, .select2-dropdown) { background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; box-shadow: var(--ttp-elev-2); color: #1a1a1a; }
.tes-shell .dropdown-item:is(.active, :active), .tes-auth .dropdown-item:is(.active, :active),
.tes-shell .select2-results__option:is([aria-selected="true"], .select2-results__option--selected, .select2-results__option--highlighted),
.tes-auth .select2-results__option:is([aria-selected="true"], .select2-results__option--selected, .select2-results__option--highlighted) { background: var(--rc-ties-bg); color: #1a1a1a; }

/* The existing auth markup wears the canvas shell without editing secure-upload.css. */
.tes-auth { font: 15px/1.6 "Segoe UI", system-ui, sans-serif; }
.tes-auth .tt-auth__hero { background: #1a1a1a; }
.tes-auth .tt-auth__hero::after { display: none; }
.tes-auth .tt-auth__inner { max-width: 34rem; min-width: 0; }
.tes-auth .tt-auth__logo { height: 40px; width: auto; max-width: 100%; object-fit: contain; }
.tes-auth .tt-auth__card { background: #262626; border: 1px solid #484848; border-radius: .75rem; padding: 2rem; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.tes-auth .tt-auth__title { font-size: 1.45rem; }
.tes-auth :is(.tt-auth__subtitle, .tt-auth__help, .tt-auth__assurance) { color: #cbd0d6; }
.tes-auth .tt-auth__label { color: #fff; font-size: .8rem; font-weight: 600; }
.tes-auth .tt-auth__input { background: #343434 !important; border: 1px solid #747474 !important; color: #fff !important; border-radius: .5rem !important; min-width: 0; }
.tes-auth .tt-auth__input::placeholder { color: #cbd0d6 !important; }
.tes-auth .tt-auth__input:focus { outline: 2px solid #00d639; outline-offset: 2px; box-shadow: none !important; }
.tes-auth .tt-auth__link { color: #fff; text-decoration: underline; }
.tes-auth .tt-auth__btn { background: #00d639; border-color: #00d639; color: #1a1a1a; border-radius: .5rem; min-height: 2.5rem; }
.tes-auth .tt-auth__btn:hover { background: #00b32f; border-color: #00b32f; color: #1a1a1a; }
.tes-auth :is(.alert, .tt-auth__note, .tt-auth__warn) { background: #fff; color: #374151; border: 2px solid #e5e7eb; border-radius: .75rem; }
.tes-auth :is(.alert-success, .tt-auth__note) { border-color: #00d639; }
.tes-auth :is(.alert-warning, .tt-auth__warn) { border-color: #fcd34d; }
.tes-auth .alert-info { border-color: var(--rc-expl-bd); }
.tes-auth :is(.tt-auth__error, .alert-danger) { background: #fff; color: #374151; border: 2px solid #fecaca; border-radius: .75rem; }
.tes-auth .alert .btn-close { filter: none; }
@media (max-width: 575.98px) {
    .tes-auth .tt-auth__card { padding: 1.25rem; }
}

/* Reduce component motion while preserving slower progress indicators. */
@media (prefers-reduced-motion: reduce) {
    :is(.tt-wiz *, [class^="tes-"], [class*=" tes-"]):not(body, html, .spinner-border, .spinner-grow, .app-loader, .app-loader *, #mv-page-loader, #mv-page-loader *),
    :is(.tt-wiz *, [class^="tes-"], [class*=" tes-"]):not(body, html, .spinner-border, .spinner-grow, .app-loader, .app-loader *, #mv-page-loader, #mv-page-loader *)::before,
    :is(.tt-wiz *, [class^="tes-"], [class*=" tes-"]):not(body, html, .spinner-border, .spinner-grow, .app-loader, .app-loader *, #mv-page-loader, #mv-page-loader *)::after {
        transition: none !important; animation: none !important; scroll-behavior: auto !important;
    }
    .tt-wiz :is(.spinner-border, .spinner-grow),
    :is([class^="tes-"], [class*=" tes-"]):not(body, html) :is(.spinner-border, .spinner-grow),
    :is([class^="tes-"], [class*=" tes-"]):is(.spinner-border, .spinner-grow) {
        animation-duration: 1.5s !important;
    }
}
