/**
 * af2-theme.css
 * AF2 LimeSurvey 6.x Theme - Full Styles v2.0.0
 * Multi-brand: Research Opinions (RO) / Healthcare Opinions (HC) /
 *              Acumen Fieldwork (AF) / Acumen Health (AH)
 *
 * Sections:
 *   1.  Fonts
 *   2.  CSS Variables — Research Opinions (Default)
 *   3.  CSS Variables — Healthcare Opinions
 *   4.  CSS Variables — Acumen Fieldwork
 *   5.  CSS Variables — Acumen Health
 *   6.  Dark Mode
 *   7.  Night Mode
 *   8.  High Contrast Mode
 *   9.  Large Text Mode
 *  10.  Extra Large Text Mode
 *  11.  Dyslexia Friendly Mode
 *  12.  Reduced Motion Mode
 *  13.  Base Styles
 *  14.  Brand Logo
 *  15.  Header / Navbar
 *  16.  Survey Container
 *  17.  Progress Bar
 *  18.  Group Container
 *  19.  Questions
 *  20.  Form Inputs
 *  21.  Radio Buttons
 *  22.  Checkboxes
 *  23.  Matrix / Array Questions
 *  24.  Slider
 *  25.  File Upload
 *  26.  Yes/No
 *  27.  Buttons
 *  28.  Navigation
 *  29.  Alerts
 *  30.  Accessibility Toolbar
 *  31.  Injected Footer
 *  32.  Injected Sub-Header
 *  33.  Accessibility Mode Overrides for Injected Elements
 *  34.  Responsive
 *  35.  Print
 */


/* =============================================================================
   1. FONTS
   ============================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700;800&family=Work+Sans:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.cdnfonts.com/css/opendyslexic');


/* =============================================================================
   2. CSS VARIABLES — RESEARCH OPINIONS (Default)
   ============================================================================= */
:root,
.theme-ro {
    /* Primary — Sky Blue */
    --af2-primary: #00ABE8;
    --af2-primary-hover: #0095CC;
    --af2-primary-active: #0088BA;
    --af2-primary-light: #E6F7FC;
    --af2-primary-rgb: 0, 171, 232;

    /* Secondary — Yellow */
    --af2-secondary: #DDDC00;
    --af2-secondary-hover: #C5C400;
    --af2-secondary-light: #FAFACC;

    /* Accent colours (from brand guidelines) */
    --af2-accent-pink: #E63362;
    --af2-accent-purple: #D83BB3;
    --af2-accent-orange: #FF5100;

    /* Brand Dark — Navy */
    --af2-dark: #0F2542;
    --af2-dark-lighter: #1A3A5C;

    /* Backgrounds */
    --af2-bg: #F0F4F8;
    --af2-card: #FFFFFF;
    --af2-input-bg: #FFFFFF;
    --af2-hover: rgba(0, 171, 232, 0.06);
    --af2-selected: rgba(0, 171, 232, 0.12);
    --af2-stripe: #F8FAFC;

    /* Text */
    --af2-text: #1E293B;
    --af2-text-heading: #0F172A;
    --af2-text-light: #64748B;
    --af2-text-muted: #94A3B8;
    --af2-text-inverse: #FFFFFF;

    /* Borders */
    --af2-border: #CBD5E1;
    --af2-border-hover: #94A3B8;
    --af2-border-focus: var(--af2-primary);

    /* Status */
    --af2-success: #22C55E;
    --af2-success-light: #DCFCE7;
    --af2-error: #EF4444;
    --af2-error-light: #FEE2E2;
    --af2-warning: #F59E0B;
    --af2-warning-light: #FEF3C7;
    --af2-info: #3B82F6;
    --af2-info-light: #DBEAFE;

    /* Shadows */
    --af2-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --af2-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --af2-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --af2-shadow-focus: 0 0 0 3px rgba(var(--af2-primary-rgb), 0.25);

    /* Radius */
    --af2-radius-sm: 0.25rem;
    --af2-radius: 0.5rem;
    --af2-radius-lg: 0.75rem;
    --af2-radius-xl: 1rem;
    --af2-radius-full: 9999px;

    /* Typography */
    --af2-font-heading: 'Baloo 2', -apple-system, BlinkMacSystemFont, sans-serif;
    --af2-font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transitions */
    --af2-transition: 200ms ease;
}


/* =============================================================================
   3. CSS VARIABLES — HEALTHCARE OPINIONS
   ============================================================================= */
.theme-hc {
    /* Primary — Green */
    --af2-primary: #85C440;
    --af2-primary-hover: #74B030;
    --af2-primary-active: #6BA032;
    --af2-primary-light: #EDF7E1;
    --af2-primary-rgb: 133, 196, 64;

    /* Brand Dark — Navy (same as RO per brand guidelines) */
    --af2-dark: #0F2542;
    --af2-dark-lighter: #1A3A5C;

    /* HC-specific hover/selected tints */
    --af2-hover: rgba(133, 196, 64, 0.08);
    --af2-selected: rgba(133, 196, 64, 0.15);
}


/* =============================================================================
   4. CSS VARIABLES — ACUMEN FIELDWORK
   ============================================================================= */
.theme-af {
    /* Primary — Navy (per brand guidelines) */
    --af2-primary: #1E3A5F;
    --af2-primary-hover: #162D4A;
    --af2-primary-active: #0F2035;
    --af2-primary-light: #E8EDF2;
    --af2-primary-rgb: 30, 58, 95;

    /* Secondary — Orange */
    --af2-secondary: #F5A623;
    --af2-secondary-hover: #E09010;
    --af2-secondary-light: #FEF3E0;

    /* Brand Dark — Navy */
    --af2-dark: #0F2542;
    --af2-dark-lighter: #1A3A5C;

    /* AF-specific hover/selected tints */
    --af2-hover: rgba(30, 58, 95, 0.08);
    --af2-selected: rgba(30, 58, 95, 0.15);
}


/* =============================================================================
   5. CSS VARIABLES — ACUMEN HEALTH
   ============================================================================= */
.theme-ah {
    /* Primary — Teal (per brand guidelines) */
    --af2-primary: #2D8C6F;
    --af2-primary-hover: #247258;
    --af2-primary-active: #1B5842;
    --af2-primary-light: #E6F3EE;
    --af2-primary-rgb: 45, 140, 111;

    /* Secondary — Orange (shared with AF) */
    --af2-secondary: #F5A623;
    --af2-secondary-hover: #E09010;
    --af2-secondary-light: #FEF3E0;

    /* Brand Dark — Navy */
    --af2-dark: #0F2542;
    --af2-dark-lighter: #1A3A5C;

    /* AH-specific hover/selected tints */
    --af2-hover: rgba(45, 140, 111, 0.08);
    --af2-selected: rgba(45, 140, 111, 0.15);
}


/* =============================================================================
   6. DARK MODE
   ============================================================================= */
.mode-dark {
    --af2-bg: #0f172a;
    --af2-card: #1e293b;
    --af2-input-bg: #1e293b;
    --af2-hover: rgba(255, 255, 255, 0.06);
    --af2-selected: rgba(255, 255, 255, 0.12);
    --af2-stripe: #273548;
    --af2-text: #e2e8f0;
    --af2-text-heading: #f1f5f9;
    --af2-text-light: #94a3b8;
    --af2-text-muted: #64748b;
    --af2-border: #475569;
    --af2-border-hover: #64748b;
    --af2-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --af2-shadow: 0 4px 6px rgba(0, 0, 0, 0.35);
    --af2-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

.mode-dark body,
.mode-dark .navbar,
.mode-dark nav.navbar {
    background-color: var(--af2-bg) !important;
}


/* =============================================================================
   7. NIGHT MODE (Warm, reduced blue light)
   ============================================================================= */
.mode-night {
    --af2-bg: #1a1610;
    --af2-card: #252018;
    --af2-input-bg: #252018;
    --af2-hover: rgba(255, 200, 100, 0.08);
    --af2-selected: rgba(255, 200, 100, 0.15);
    --af2-stripe: #2a2318;
    --af2-text: #e8dfd0;
    --af2-text-heading: #f5efe5;
    --af2-text-light: #c4b8a0;
    --af2-text-muted: #8a7e68;
    --af2-border: #4a4030;
    --af2-border-hover: #5a5040;
    --af2-primary: #e8a040;
    --af2-primary-hover: #d89030;
    --af2-primary-light: #3a3020;
    --af2-primary-rgb: 232, 160, 64;
}

.mode-night body {
    filter: sepia(8%) saturate(90%);
}

/* Prevent sepia filter from affecting images */
.mode-night img {
    filter: sepia(0%) saturate(100%);
}


/* =============================================================================
   8. HIGH CONTRAST MODE
   ============================================================================= */
.mode-contrast {
    --af2-bg: #000000;
    --af2-card: #000000;
    --af2-input-bg: #000000;
    --af2-hover: #222222;
    --af2-selected: #333333;
    --af2-stripe: #111111;
    --af2-text: #ffffff;
    --af2-text-heading: #ffffff;
    --af2-text-light: #ffffff;
    --af2-text-muted: #cccccc;
    --af2-border: #ffffff;
    --af2-border-hover: #ffffff;
    --af2-primary: #00ffff;
    --af2-primary-hover: #00cccc;
    --af2-primary-light: #003333;
    --af2-primary-rgb: 0, 255, 255;
    --af2-secondary: #ffff00;
    --af2-success: #00ff00;
    --af2-error: #ff0000;
    --af2-shadow-sm: none;
    --af2-shadow: none;
    --af2-shadow-lg: none;
    --af2-shadow-focus: 0 0 0 4px #ffff00;
}

.mode-contrast a {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

.mode-contrast *:focus {
    outline: 3px solid #ffff00 !important;
    outline-offset: 2px !important;
}

.mode-contrast input,
.mode-contrast select,
.mode-contrast textarea,
.mode-contrast button,
.mode-contrast .btn {
    border-width: 2px !important;
}


/* =============================================================================
   9. LARGE TEXT MODE
   ============================================================================= */
.mode-large {
    font-size: 18px !important;
}

.mode-large .question-text,
.mode-large .ls-label-question {
    font-size: 1.5rem !important;
}

.mode-large .form-control,
.mode-large input,
.mode-large textarea,
.mode-large select {
    font-size: 1.125rem !important;
    padding: 0.875rem 1rem !important;
}

.mode-large .btn {
    font-size: 1.125rem !important;
    padding: 0.875rem 1.5rem !important;
}

.mode-large .radio-list label,
.mode-large .checkbox-list label {
    font-size: 1.125rem !important;
    padding: 1rem !important;
}


/* =============================================================================
   10. EXTRA LARGE TEXT MODE
   ============================================================================= */
.mode-xlarge {
    font-size: 22px !important;
    line-height: 1.6 !important;
}

.mode-xlarge .question-text,
.mode-xlarge .ls-label-question {
    font-size: 1.75rem !important;
}

.mode-xlarge .form-control,
.mode-xlarge input,
.mode-xlarge textarea,
.mode-xlarge select {
    font-size: 1.375rem !important;
    padding: 1rem 1.25rem !important;
    min-height: 60px !important;
}

.mode-xlarge .btn {
    font-size: 1.375rem !important;
    padding: 1rem 2rem !important;
    min-height: 60px !important;
}

.mode-xlarge .radio-list label,
.mode-xlarge .checkbox-list label {
    font-size: 1.25rem !important;
    padding: 1.25rem !important;
}


/* =============================================================================
   11. DYSLEXIA FRIENDLY MODE
   ============================================================================= */
.mode-dyslexia {
    --af2-bg: #faf8f0;
    --af2-card: #fffff8;
    --af2-input-bg: #fffff8;
    --af2-font-body: 'OpenDyslexic', 'Comic Sans MS', Arial, sans-serif;
    --af2-font-heading: 'OpenDyslexic', 'Comic Sans MS', Arial, sans-serif;
}

.mode-dyslexia,
.mode-dyslexia * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', Arial, sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.16em !important;
}

.mode-dyslexia p,
.mode-dyslexia li,
.mode-dyslexia label,
.mode-dyslexia span {
    line-height: 1.8 !important;
}

.mode-dyslexia em,
.mode-dyslexia i {
    font-style: normal !important;
    font-weight: 600 !important;
}


/* =============================================================================
   12. REDUCED MOTION MODE
   ============================================================================= */
.mode-motion *,
.mode-motion *::before,
.mode-motion *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}


/* =============================================================================
   13. BASE STYLES
   ============================================================================= */
body {
    font-family: var(--af2-font-body);
    background-color: var(--af2-bg);
    color: var(--af2-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: 86px !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--af2-font-heading);
    color: var(--af2-text-heading);
    font-weight: 600;
}

a {
    color: var(--af2-primary);
    text-decoration: none;
    transition: color var(--af2-transition);
}

a:hover {
    color: var(--af2-primary-hover);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--af2-primary);
    outline-offset: 2px;
    border-radius: var(--af2-radius-sm);
}

::selection {
    background: var(--af2-primary);
    color: var(--af2-text-inverse);
}


/* =============================================================================
   14. BRAND LOGO
   ============================================================================= */
#af2-brand-logo,
.af2-brand-logo {
    display: none !important;
}


/* =============================================================================
   15. HEADER / NAVBAR
   ============================================================================= */
.navbar,
nav.navbar,
header.navbar {
    background-color: var(--af2-dark) !important;
    padding: 0.75rem 1.5rem !important;
}

.navbar-brand {
    font-family: var(--af2-font-heading) !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    color: var(--af2-text-inverse) !important;
}

/* "Resume later" and other navbar action links */
.navbar-action-link .nav-link,
.navbar-action-link a {
    color: var(--af2-text-inverse) !important;
    font-size: 0.8rem !important;
    padding: 0.5rem 1rem !important;
}


/* Compress top spacing between navbar and survey content */
.top-container {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
}

.top-container.space-col {
    padding: 0 !important;
    margin: 0 !important;
}

/* =============================================================================
   16. SURVEY CONTAINER
   -- Widened to 95% (capped at 1320px) to fix array/matrix clipping on desktop
   ============================================================================= */
#outerframeContainer,
.outerframe,
.outerframe.container-md {
    max-width: 95% !important;
    width: 95% !important;
    margin: 0.25rem auto;
    padding: 0 1rem;
}

/* Cap width on very large screens so it does not stretch too wide */
@media (min-width: 1400px) {
    #outerframeContainer,
    .outerframe,
    .outerframe.container-md {
        max-width: 1320px !important;
    }
}

#surveycontainer,
.survey-container,
.ls-survey-form {
    background: var(--af2-card);
    border-radius: var(--af2-radius-xl);
    box-shadow: var(--af2-shadow-lg);
    overflow: hidden;
}


/* =============================================================================
   17. PROGRESS BAR
   ============================================================================= */
.progress {
    height: 12px !important;
    background-color: var(--af2-border) !important;
    border-radius: var(--af2-radius-full) !important;
    overflow: hidden !important;
    margin: 0.25rem 1.5rem 1rem !important;
}

.progress-bar {
    background: linear-gradient(90deg, var(--af2-primary), var(--af2-primary-hover)) !important;
    border-radius: var(--af2-radius-full) !important;
    transition: width 0.4s ease !important;
}


/* =============================================================================
   18. GROUP CONTAINER
   ============================================================================= */
.group-outer-container,
.group-container {
    padding: 1.5rem 2rem;
}

.group-title h2,
.group-title h3 {
    font-family: var(--af2-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--af2-primary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--af2-primary);
}

.group-description {
    font-size: 1rem;
    color: var(--af2-text-light);
    margin-bottom: 1.5rem;
}


/* =============================================================================
   19. QUESTIONS
   ============================================================================= */
.question-container,
[id^="question"] {
    background: var(--af2-card);
    border: 2px solid transparent;
    border-radius: var(--af2-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: border-color var(--af2-transition), box-shadow var(--af2-transition);
}

.question-container:hover {
    border-color: var(--af2-primary-light);
}

.question-container:focus-within {
    border-color: var(--af2-primary);
    box-shadow: var(--af2-shadow-sm);
}

/* Error state */
.question-container.has-error,
.question-container.input-error,
.question-container.ls-error {
    border-color: var(--af2-error) !important;
    background: var(--af2-error-light) !important;
}

.question-text,
.ls-label-question {
    font-family: var(--af2-font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--af2-text-heading);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.question-help,
.ls-questionhelp,
.question-help-container {
    font-size: 0.875rem;
    color: var(--af2-text-light);
    background: var(--af2-primary-light);
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--af2-primary);
    border-radius: var(--af2-radius);
    margin-bottom: 1rem;
}

.asterisk,
.text-danger.asterisk {
    color: var(--af2-error) !important;
    font-weight: 700;
}


/* =============================================================================
   20. FORM INPUTS
   ============================================================================= */
.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem !important;
    font-family: var(--af2-font-body) !important;
    font-size: 1rem !important;
    color: var(--af2-text) !important;
    background-color: var(--af2-input-bg) !important;
    border: 2px solid var(--af2-border) !important;
    border-radius: var(--af2-radius) !important;
    transition: border-color var(--af2-transition), box-shadow var(--af2-transition) !important;
}

.form-control:hover,
input:hover,
textarea:hover,
select:hover {
    border-color: var(--af2-border-hover) !important;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--af2-border-focus) !important;
    box-shadow: var(--af2-shadow-focus) !important;
    outline: none !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--af2-text-muted) !important;
}

textarea.form-control,
textarea {
    min-height: 120px;
    resize: vertical;
}

/* Select dropdown arrow */
select.form-control,
select.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 2.5rem !important;
}


/* =============================================================================
   21. RADIO BUTTONS
   ============================================================================= */
.radio-list,
.list-unstyled.radio-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-list li,
.radio-item {
    position: relative;
}

.radio-list label {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--af2-input-bg);
    border: 2px solid var(--af2-border);
    border-radius: var(--af2-radius);
    cursor: pointer;
    transition: all var(--af2-transition);
    font-weight: 500;
}

.radio-list label:hover {
    border-color: var(--af2-primary);
    background: var(--af2-hover);
}

.radio-list input[type="radio"] {
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--af2-primary);
    flex-shrink: 0;
}

/* Selected state — :has() with JS fallback class */
.radio-list input[type="radio"]:checked + label,
.radio-list label:has(input[type="radio"]:checked),
.radio-list label.af2-selected {
    border-color: var(--af2-primary);
    background: var(--af2-selected);
}


/* =============================================================================
   22. CHECKBOXES
   ============================================================================= */
.checkbox-list,
.list-unstyled.checkbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-list li,
.checkbox-item {
    position: relative;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--af2-input-bg);
    border: 2px solid var(--af2-border);
    border-radius: var(--af2-radius);
    cursor: pointer;
    transition: all var(--af2-transition);
    font-weight: 500;
}

.checkbox-list label:hover {
    border-color: var(--af2-primary);
    background: var(--af2-hover);
}

.checkbox-list input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--af2-primary);
    flex-shrink: 0;
}

/* Selected state — :has() with JS fallback class */
.checkbox-list input[type="checkbox"]:checked + label,
.checkbox-list label:has(input[type="checkbox"]:checked),
.checkbox-list label.af2-selected {
    border-color: var(--af2-primary);
    background: var(--af2-selected);
}

/* Prevent checkbox/radio list scrollbar from Bootstrap row negative margins */
.checkbox-list,
.radio-list,
ul.ls-answers {
    overflow-x: hidden !important;
}

.checkbox-list .row,
.radio-list .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.checkbox-list .row > [class*="col"],
.radio-list .row > [class*="col"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}


/* =============================================================================
   23. MATRIX / ARRAY QUESTIONS
   — Fixed: table now uses table-layout: auto with proper min-widths
   — to prevent options stacking on large screens
   ============================================================================= */
.ls-answers table,
table.ls-answers,
.array-flexible-row table,
.array-flexible-column table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    table-layout: auto;
}

/* Ensure the table container does not collapse */
.ls-answers,
.array-flexible-row,
.array-flexible-column,
.question-container .ls-answers,
.question-container .ls-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ls-answers th,
table.ls-answers th {
    /* background: var(--af2-primary);
       color: var(--af2-text-inverse); */
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    white-space: nowrap;
}

.ls-answers th:first-child {
    text-align: left;
    border-radius: var(--af2-radius) 0 0 0;
    min-width: 200px;
}

.ls-answers th:last-child {
    border-radius: 0 var(--af2-radius) 0 0;
}

.ls-answers td,
table.ls-answers td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--af2-border);
    text-align: center;
    vertical-align: middle;
}

.ls-answers td:first-child {
    text-align: left;
    font-weight: 500;
    background: var(--af2-stripe);
    min-width: 200px;
}

.ls-answers tr:nth-child(even) td {
    background: var(--af2-stripe);
}

.ls-answers tr:hover td {
    background: var(--af2-hover);
}

.ls-answers input[type="radio"],
.ls-answers input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--af2-primary);
    cursor: pointer;
}

/* Force desktop matrix to stay as a proper grid */
@media (min-width: 769px) {
    .ls-answers table,
    table.ls-answers,
    .array-flexible-row table,
    .array-flexible-column table {
        display: table !important;
        width: 100% !important;
    }

    .ls-answers thead,
    table.ls-answers thead {
        display: table-header-group !important;
    }

    .ls-answers tbody,
    table.ls-answers tbody {
        display: table-row-group !important;
    }

    .ls-answers tr,
    table.ls-answers tr {
        display: table-row !important;
    }

    .ls-answers th,
    .ls-answers td,
    table.ls-answers th,
    table.ls-answers td {
        display: table-cell !important;
    }
}


/* =============================================================================
   24. SLIDER
   ============================================================================= */
input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--af2-border);
    border-radius: var(--af2-radius-full);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 1.5rem 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--af2-primary);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid var(--af2-card);
    box-shadow: var(--af2-shadow);
    transition: transform var(--af2-transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--af2-primary);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid var(--af2-card);
}


/* =============================================================================
   25. FILE UPLOAD
   ============================================================================= */
.upload-container,
.uploadfiles {
    border: 2px dashed var(--af2-border);
    border-radius: var(--af2-radius-lg);
    padding: 2rem;
    text-align: center;
    background: var(--af2-hover);
    transition: all var(--af2-transition);
}

.upload-container:hover {
    border-color: var(--af2-primary);
    background: var(--af2-selected);
}


/* =============================================================================
   26. YES/NO
   ============================================================================= */
.yes-no-buttons,
.yn-btn-group {
    display: flex;
    gap: 1rem;
}

.yes-no-buttons .btn {
    flex: 1;
    padding: 1rem 1.5rem !important;
}

/* Prevent scrollbar on Yes/No and button groups */
.btn-group-justified,
.btn-group {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.btn-group-justified .btn,
.btn-group .btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}


/* =============================================================================
   27. BUTTONS
   ============================================================================= */
.btn {
    font-family: var(--af2-font-body);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--af2-radius);
    transition: all var(--af2-transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--af2-shadow-focus);
}

.btn-primary,
#movenextbtn,
#ls-button-submit,
input[type="submit"].btn {
    background-color: var(--af2-primary) !important;
    border-color: var(--af2-primary) !important;
    color: var(--af2-text-inverse) !important;
}

.btn-primary:hover,
#movenextbtn:hover,
#ls-button-submit:hover {
    background-color: var(--af2-primary-hover) !important;
    border-color: var(--af2-primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: var(--af2-shadow);
}

.btn-secondary,
.btn-outline-secondary,
#moveprevbtn {
    background-color: transparent !important;
    border: 2px solid var(--af2-border) !important;
    color: var(--af2-text) !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
#moveprevbtn:hover {
    border-color: var(--af2-primary) !important;
    color: var(--af2-primary) !important;
    background-color: var(--af2-hover) !important;
}

#ls-button-submit {
    padding: 1rem 2rem !important;
    font-size: 1.125rem !important;
    background: linear-gradient(135deg, var(--af2-primary), var(--af2-primary-hover)) !important;
}


/* =============================================================================
   28. NAVIGATION
   ============================================================================= */
.navigator,
#navigator-container,
.survey-buttons {
    background: var(--af2-card);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--af2-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}


/* =============================================================================
   29. ALERTS
   ============================================================================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--af2-radius);
    border-left: 4px solid;
    margin-bottom: 1rem;
}

.alert-info {
    background: var(--af2-info-light) !important;
    border-color: var(--af2-info) !important;
    color: var(--af2-text) !important;
}

.alert-success {
    background: var(--af2-success-light) !important;
    border-color: var(--af2-success) !important;
    color: var(--af2-text) !important;
}

.alert-warning {
    background: var(--af2-warning-light) !important;
    border-color: var(--af2-warning) !important;
    color: var(--af2-text) !important;
}

.alert-danger {
    background: var(--af2-error-light) !important;
    border-color: var(--af2-error) !important;
    color: var(--af2-text) !important;
}


/* =============================================================================
   30. ACCESSIBILITY TOOLBAR
   ============================================================================= */
.af2-a11y {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 99999;
    font-family: var(--af2-font-body);
}

.af2-a11y-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--af2-dark);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.af2-a11y-btn:hover {
    background: var(--af2-primary);
    transform: scale(1.08);
}

.af2-a11y-btn:focus {
    outline: 3px solid var(--af2-secondary);
    outline-offset: 3px;
}

.af2-a11y-btn svg {
    width: 28px;
    height: 28px;
}

.af2-a11y-panel {
    position: absolute;
    bottom: 65px;
    left: 0;
    background: var(--af2-card);
    border-radius: var(--af2-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    min-width: 300px;
    max-width: 340px;
    display: none;
    border: 1px solid var(--af2-border);
    color: var(--af2-text);
}

.af2-a11y-panel.open {
    display: block;
    animation: af2-fade-in 0.2s ease;
}

@keyframes af2-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.af2-a11y-panel h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--af2-primary);
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--af2-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.af2-a11y-panel h3 svg {
    width: 20px;
    height: 20px;
}

.af2-a11y-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--af2-border);
}

.af2-a11y-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.af2-a11y-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--af2-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.af2-a11y-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.af2-a11y-option label {
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--af2-text);
}

.af2-a11y-option label svg {
    width: 18px;
    height: 18px;
    color: var(--af2-text-muted);
}

/* Toggle switch */
.af2-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.af2-toggle input {
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
    z-index: 1;
    margin: 0;
}

.af2-toggle-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--af2-border);
    border-radius: 999px;
    transition: background 0.2s ease;
}

.af2-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.af2-toggle input:checked + .af2-toggle-track {
    background: var(--af2-primary);
}

.af2-toggle input:checked + .af2-toggle-track .af2-toggle-thumb {
    transform: translateX(22px);
}

.af2-toggle input:focus + .af2-toggle-track {
    box-shadow: 0 0 0 3px rgba(var(--af2-primary-rgb), 0.3);
}

/* Text size buttons */
.af2-size-btns {
    display: flex;
    gap: 0.5rem;
}

.af2-size-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--af2-border);
    border-radius: var(--af2-radius);
    background: var(--af2-input-bg);
    cursor: pointer;
    font-weight: 700;
    color: var(--af2-text-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.af2-size-btn:hover {
    border-color: var(--af2-primary);
    color: var(--af2-primary);
}

.af2-size-btn.active {
    background: var(--af2-primary);
    border-color: var(--af2-primary);
    color: #fff;
}

/* Reset button */
.af2-reset-btn {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.625rem;
    background: var(--af2-hover);
    border: 1px solid var(--af2-border);
    border-radius: var(--af2-radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--af2-text-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.af2-reset-btn:hover {
    background: var(--af2-error);
    border-color: var(--af2-error);
    color: #fff;
}

.af2-reset-btn svg {
    width: 16px;
    height: 16px;
}


/* =============================================================================
   31. INJECTED FOOTER
   ============================================================================= */
.af2-ls-footer {
    background-color: var(--af2-dark) !important;
    color: var(--af2-text-inverse) !important;
    text-align: center !important;
    padding: 20px !important;
    font-size: 0.85rem !important;
    margin-top: 40px !important;
    font-family: 'Work Sans', sans-serif !important;
}

.af2-ls-footer p {
    margin: 0.25rem 0 !important;
    color: var(--af2-text-inverse) !important;
}

.af2-ls-footer a {
    color: var(--af2-primary) !important;
    text-decoration: underline !important;
}

.af2-ls-footer a:hover {
    color: var(--af2-primary-hover) !important;
}


/* =============================================================================
   32. INJECTED SUB-HEADER
   ============================================================================= */
.af2-ls-subheader {
    background-color: var(--af2-primary-light) !important;
    color: var(--af2-text) !important;
    text-align: center !important;
    padding: 10px 20px !important;
    font-size: 0.85rem !important;
    font-family: 'Work Sans', sans-serif !important;
    border-bottom: 1px solid var(--af2-border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    position: relative !important;
    z-index: 1020 !important;
}

.af2-ls-subheader svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    color: var(--af2-primary) !important;
}


/* =============================================================================
   33. ACCESSIBILITY MODE OVERRIDES FOR INJECTED ELEMENTS
   ============================================================================= */

/* Dark mode - footer */
.mode-dark .af2-ls-footer {
    background-color: #0f172a !important;
    border-top: 1px solid #475569 !important;
}

.mode-dark .af2-ls-footer p {
    color: #e2e8f0 !important;
}

/* Dark mode - sub-header */
.mode-dark .af2-ls-subheader {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-bottom-color: #475569 !important;
}

.mode-dark .af2-ls-subheader svg {
    color: #38bdf8 !important;
}

.mode-dark .af2-ls-subheader span {
    color: #e2e8f0 !important;
}

/* High contrast mode - footer */
.mode-contrast .af2-ls-footer {
    background-color: #000000 !important;
    border-top: 2px solid #ffffff !important;
}

.mode-contrast .af2-ls-footer p {
    color: #ffffff !important;
}

.mode-contrast .af2-ls-footer a {
    color: #ffff00 !important;
}

/* High contrast mode - sub-header */
.mode-contrast .af2-ls-subheader {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-bottom: 2px solid #ffffff !important;
}

.mode-contrast .af2-ls-subheader svg {
    color: #00ffff !important;
}

.mode-contrast .af2-ls-subheader span {
    color: #ffffff !important;
}

/* Night mode - footer */
.mode-night .af2-ls-footer {
    background-color: #1a1610 !important;
    border-top: 1px solid #4a4030 !important;
}

.mode-night .af2-ls-footer p {
    color: #e8dfd0 !important;
}

/* Night mode - sub-header */
.mode-night .af2-ls-subheader {
    background-color: #252018 !important;
    color: #e8dfd0 !important;
    border-bottom-color: #4a4030 !important;
}

.mode-night .af2-ls-subheader svg {
    color: #d4a857 !important;
}

.mode-night .af2-ls-subheader span {
    color: #e8dfd0 !important;
}


/* =============================================================================
   34. RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
    #outerframeContainer {
        margin: 0.5rem auto;
        padding: 0 0.5rem;
    }

    .af2-ls-footer {
        margin-top: 20px !important;
        padding: 16px !important;
        font-size: 0.8rem !important;
    }

    .group-outer-container,
    .group-container {
        padding: 1rem 1.25rem;
    }

    .question-container {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .question-text,
    .ls-label-question {
        font-size: 1.125rem;
    }

    .navigator,
    .survey-buttons {
        flex-direction: column;
        padding: 1rem 1.25rem;
    }

    .navigator .btn {
        width: 100%;
    }

    .af2-a11y-panel {
        min-width: calc(100vw - 2rem);
        left: 0;
        right: 1rem;
    }

    /* Matrix tables scroll horizontally on mobile */
    .ls-answers table,
    table.ls-answers {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

}

@media (max-width: 480px) {
    .af2-a11y {
        bottom: 0.5rem;
        left: 0.5rem;
    }

    .af2-a11y-btn {
        width: 50px;
        height: 50px;
    }

    .af2-a11y-btn svg {
        width: 24px;
        height: 24px;
    }
}


/* =============================================================================
   35. PRINT
   ============================================================================= */
@media print {
    .af2-a11y,
    .navigator,
    .survey-buttons,
    .navbar,
    nav,
    .progress,
    .af2-ls-footer,
    .af2-ls-subheader {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        padding-top: 0 !important;
    }

    #surveycontainer,
    .survey-container {
        box-shadow: none !important;
    }

    .question-container {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
}
