/**
 * DMARC Report Analyzer - Professional Responsive Design
 * Mobile-first with industry best practices
 */

@import url('https://fonts.googleapis.com/css2?family=Muli:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ========================================== */
/* CSS CUSTOM PROPERTIES (VARIABLES)          */
/* ========================================== */

:root {
    --color-primary:       #4875F4;
    --color-primary-hover: #025dcc;
    --color-text:          #646C9A;
    --color-text-dark:     #48465b;
    --color-border:        #E1E1EB;
    --color-bg-light:      #F7F8FA;
    --color-success:       #0abb87;
    --color-warning:       #FFA800;
    --color-error:         #F4516C;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    --font-size-sm:   0.75rem;
    --font-size-base: 0.875rem;
    --font-size-md:   1rem;
    --font-size-lg:   1.125rem;
    --font-size-xl:   1.25rem;

    --border-radius:    0.25rem;
    --border-radius-lg: 0.5rem;
    --box-shadow:       0 0 13px 0 rgba(82, 63, 105, 0.05);
    --box-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================== */
/* BASE & RESET                               */
/* ========================================== */

@keyframes _dmarc-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.dmarc-report-analyzer .av-section-cont-open {
    max-width: 1500px !important;
}

.dmarc-report-analyzer,
.dmarc-report-analyzer * {
    box-sizing: border-box !important;
}

.dmarc-report-analyzer .dmarc-analyzer-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    font-family: 'Muli', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: var(--color-text) !important;
    line-height: 1.6 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* ========================================== */
/* CONTAINER & GRID SYSTEM - MOBILE FIRST     */
/* Neutralises Enfold theme .row interference */
/* ========================================== */

.dmarc-report-analyzer .row,
.dmarc-analyzer-wrapper .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    clear: none !important;
    zoom: normal !important;
    position: relative !important;
}

.dmarc-main-section.dmarc-input-section {
    margin: 0 auto;
    max-width: 40rem;
    margin-top: -13rem;
    border-radius: 4vw !important;
}

.dmarc-report-analyzer [class*="col-"],
.dmarc-analyzer-wrapper [class*="col-"] {
    position: relative !important;
    width: 100% !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    margin-bottom: var(--spacing-md) !important;
    float: none !important;
}

/* Mobile default: all columns full width */
.dmarc-report-analyzer .col-3,
.dmarc-report-analyzer .col-4,
.dmarc-report-analyzer .col-5,
.dmarc-report-analyzer .col-12,
.dmarc-analyzer-wrapper .col-3,
.dmarc-analyzer-wrapper .col-4,
.dmarc-analyzer-wrapper .col-5,
.dmarc-analyzer-wrapper .col-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* 768px – 1279px:
   col-5 (charts)  = 100% full row
   col-4 + col-3   = 50% each side by side */
@media (min-width: 48em) and (max-width: 79.9375em) {
    .dmarc-report-analyzer .col-5,
    .dmarc-analyzer-wrapper .col-5 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .dmarc-report-analyzer .col-4,
    .dmarc-analyzer-wrapper .col-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .dmarc-report-analyzer .col-3,
    .dmarc-analyzer-wrapper .col-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* 1280px+:
   col-5 = 41.6%   col-4 = 33.3%   col-3 = 25% */
@media (min-width: 80em) {
    .dmarc-report-analyzer .col-5,
    .dmarc-analyzer-wrapper .col-5 {
        flex: 0 0 41.666667% !important;
        max-width: 41.666667% !important;
    }

    .dmarc-report-analyzer .col-4,
    .dmarc-analyzer-wrapper .col-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }

    .dmarc-report-analyzer .col-3,
    .dmarc-analyzer-wrapper .col-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
}

/* ========================================== */
/* PORTLET BODY — FULL WIDTH FIX              */
/* ========================================== */

.dmarc-report-analyzer .kt-portlet__body,
.dmarc-analyzer-wrapper .kt-portlet__body {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: var(--spacing-sm) !important;
    background: white !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--box-shadow) !important;
    margin-bottom: var(--spacing-md) !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .kt-portlet__body,
    .dmarc-analyzer-wrapper .kt-portlet__body {
        padding: var(--spacing-lg) var(--spacing-md) !important;
    }
}

.dmarc-report-analyzer .kt-portlet__body .row,
.dmarc-analyzer-wrapper .kt-portlet__body .row {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ========================================== */
/* SPACING UTILITIES                          */
/* ========================================== */

.dmarc-report-analyzer .kt-margin-b-10,
.dmarc-analyzer-wrapper .kt-margin-b-10 {
    margin-bottom: 0.625rem !important;
}

.dmarc-report-analyzer .kt-margin-t-10,
.dmarc-analyzer-wrapper .kt-margin-t-10 {
    margin-top: 0.625rem !important;
}

.dmarc-report-analyzer .kt-margin-r-20,
.dmarc-analyzer-wrapper .kt-margin-r-20 {
    margin-right: 0 !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .kt-margin-r-20,
    .dmarc-analyzer-wrapper .kt-margin-r-20 {
        margin-right: 1.25rem !important;
    }
}

.dmarc-report-analyzer .kt-padding-b-0 {
    padding-bottom: 0 !important;
}

/* ========================================== */
/* UPLOAD SECTION                             */
/* ========================================== */

/* ========================================== */
/* UPLOAD SECTION — compact, professional     */
/* ========================================== */

.dmarc-report-analyzer .dmarc-main-section {
    background: #ffffff !important;    
    padding: 2rem 2.5rem !important;
    margin-bottom: var(--spacing-lg) !important;
    box-shadow: 0 8px 40px rgba(72, 117, 244, 0.08) !important;
    text-align: center !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .dmarc-main-section {
        padding: 2.5rem 4rem !important;
    }
}

.dmarc-report-analyzer .dmarc-description {
    font-family: 'Muli' !important;
    margin: 0 0 1.25rem 0 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;    
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .dmarc-description {
        font-size: 1.125rem !important;
    }
}

/* ── Drop zone container ── */

.dmarc-report-analyzer .upload-container {
    border: 2px dashed #D5D8E8 !important;
    border-radius: 0.75rem !important;
    background: #F7F8FC !important;
    cursor: pointer !important;
    max-width: 30rem !important;
    margin: 0 auto 1.25rem auto !important;
    overflow: hidden !important;
    transition: border-color 0.25s ease, background 0.25s ease !important;
}

.dmarc-report-analyzer .upload-container:hover,
.dmarc-report-analyzer .upload-container.drag-over {
    border-color: var(--color-primary) !important;
    background: #EEF2FF !important;
}

/* ── Idle prompt state ── */

.dmarc-report-analyzer .upload-area {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem !important;
    padding: 1.5rem 1.25rem !important;
}

.dmarc-report-analyzer .upload-icon {
    color: var(--color-primary) !important;
    opacity: 0.65 !important;
    margin-bottom: 0.2rem !important;
    line-height: 1 !important;
}

.dmarc-report-analyzer .upload-text {
    font-family: 'Muli' !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    color: #3E4369 !important;
    margin: 0 !important;
}

.dmarc-report-analyzer .upload-text strong {
    color: var(--color-primary) !important;
    font-weight: 700 !important;
}

.dmarc-report-analyzer .upload-subtext {
    font-family: 'Muli' !important;
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    color: #A1A8C3 !important;
    margin: 0 !important;
}

/* ── File selected state (swaps inside the same box) ── */

.dmarc-report-analyzer .file-info {
    /* base — no display:flex, JS controls it */
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    padding: 0.9rem 1rem !important;
    cursor: default !important;
}

.dmarc-report-analyzer .file-info[style*="display: flex"],
.dmarc-report-analyzer .file-info[style*="display:flex"] {
    display: flex !important;
}

.dmarc-report-analyzer .file-details {
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    min-width: 0 !important;
    flex: 1 !important;
    color: var(--color-primary) !important;
}

.dmarc-report-analyzer .file-text {
    margin-left: 1rem;
    min-width: 0 !important;
    text-align: left !important;
}

.dmarc-report-analyzer .file-name {
    font-family: 'Muli' !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

.dmarc-report-analyzer .file-size {
    font-family: 'Muli' !important;
    font-size: 0.6875rem !important;
    color: var(--color-text) !important;
    margin: 0 !important;
}

.dmarc-report-analyzer .btn-remove-file {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    padding: 4px !important;
    cursor: pointer !important;
    color: #C4C9DA !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    transition: color 0.15s ease !important;
}

.dmarc-report-analyzer .btn-remove-file:hover {
    color: #F4516C !important;
}

/* ── Analyze button ── */

.dmarc-report-analyzer .dmarc-analyze-btn {
    font-family: 'Muli' !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 15rem !important;
    height: 2.75rem !important;
    padding: 0 1.5rem !important;
    border-radius: 0.5rem !important;
    border: none !important;
    background: var(--color-primary) !important;
    color: #fff !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease !important;
}

.dmarc-report-analyzer .dmarc-analyze-btn:hover:not(:disabled) {
    background: var(--color-primary-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(72, 117, 244, 0.3) !important;
}

.dmarc-report-analyzer .dmarc-analyze-btn:disabled {
    background: #D1D5E8 !important;
    color: #9FA5C0 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Inline error ── */

.dmarc-report-analyzer .dmarc-error {
    max-width: 36rem !important;
    margin: 0 auto 0.75rem auto !important;
    padding: 0.6rem 1rem !important;
    background: #FFF0F3 !important;
    border: 1px solid #F4516C !important;
    border-radius: 0.5rem !important;
    font-family: 'Muli' !important;
    font-size: 0.8125rem !important;
    color: #F4516C !important;
    text-align: left !important;
}
/* ========================================== */
/* FILE DISPLAY                               */
/* ========================================== */

.dmarc-report-analyzer .selected-file {
    background: white !important;
    border: 1px solid #EBEDF2 !important;
    border-radius: var(--border-radius) !important;
    padding: var(--spacing-sm) !important;
    margin: var(--spacing-md) auto !important;
    max-width: 37.5rem !important;
    /* NO display:flex here — JS controls visibility via style attribute */
    align-items: center !important;
    justify-content: space-between !important;
    gap: var(--spacing-sm) !important;
}

/* Only show as flex when JS explicitly sets it */
.dmarc-report-analyzer .selected-file[style*="display: flex"],
.dmarc-report-analyzer .selected-file[style*="display:flex"] {
    display: flex !important;
}

.dmarc-report-analyzer .file-info {
    padding-top: 0px !important;
    display: flex;
    align-items: center !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.dmarc-report-analyzer .file-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.dmarc-report-analyzer .file-name {
    font-family: 'Muli' !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.dmarc-report-analyzer .file-size {
    font-family: 'Muli' !important;
    font-size: var(--font-size-base) !important;
    color: var(--color-text) !important;
}

.dmarc-report-analyzer .btn-remove-file {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    padding: 4px !important;
    cursor: pointer !important;
    color: #A1A8C3 !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    transition: color 0.15s ease !important;
}

.dmarc-report-analyzer .btn-remove-file:hover {
    color: #F4516C !important;
}

/* ========================================== */
/* STATUS & LOADING                           */
/* ========================================== */

.dmarc-report-analyzer .dmarc-spinner {
    width: 1.25rem !important;
    height: 1.25rem !important;
    border: 3px solid #EBEDF2 !important;
    border-top-color: #5867DD !important;
    border-radius: 50% !important;
    animation: dmarcSpin 0.8s linear infinite !important;
    flex-shrink: 0 !important;
}

@keyframes dmarcSpin {
    to { transform: rotate(360deg); }
}

/* Loading overlay base — NO display:flex here, JS controls it */
.dmarc-report-analyzer .loading-overlay,
#loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(4px) !important;
    /* NO display:flex — respects style="display:none" on page load */
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 16px !important;
    z-index: 999999 !important; /* beats Enfold header z-index */
}

/* Only show as flex when jQuery fadeIn() sets the style attribute */
.dmarc-report-analyzer .loading-overlay[style*="display: flex"],
.dmarc-report-analyzer .loading-overlay[style*="display:flex"],
#loading-overlay[style*="display: flex"],
#loading-overlay[style*="display:flex"] {
    display: flex !important;
}

.dmarc-report-analyzer .loading-message,
#loading-overlay .loading-message {
    font-family: 'Muli', 'Mulish', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #565D85 !important;
    margin: 0 !important;
}

.dmarc-report-analyzer .spinner-large {
    width: 4rem !important;
    height: 4rem !important;
    border: 6px solid #EBEDF2 !important;
    border-top-color: #5867DD !important;
    border-radius: 50% !important;
    animation: dmarcSpin 0.8s linear infinite !important;
    margin: 0 auto var(--spacing-md) !important;
}

/* ========================================== */
/* RESULTS SECTION                            */
/* ========================================== */

.dmarc-report-analyzer .results-wrapper {
    margin-top: -12rem !important;
    border-radius: 4vw !important;
    padding: var(--spacing-sm) !important;
    background: white !important;    
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .results-wrapper {
        padding: var(--spacing-md) !important;
    }
}

.dmarc-report-analyzer .results-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--spacing-sm) !important;
    justify-content: center !important;
    margin-bottom: var(--spacing-md) !important;
}

@media (min-width: 36em) {
    .dmarc-report-analyzer .results-actions {
        flex-direction: row !important;
    }
}

.dmarc-report-analyzer .btn-action {
    font-family: 'Muli' !important;
    width: 100% !important;
    min-height: 2.5rem !important;
    padding: 0 var(--spacing-md) !important;
    border-radius: var(--border-radius) !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 400 !important;
    font-size: var(--font-size-base) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--spacing-xs) !important;
    transition: all 0.3s ease !important;
    color: white !important;
}

@media (min-width: 36em) {
    .dmarc-report-analyzer .btn-action {
        width: auto !important;
    }
}

.dmarc-report-analyzer .btn-export {
    background: var(--color-warning) !important;
}

.dmarc-report-analyzer .btn-export:hover {
    background: #E69500 !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--box-shadow-hover) !important;
}

.dmarc-report-analyzer .btn-email {
    background: var(--color-primary) !important;
}

.dmarc-report-analyzer .btn-email:hover {
    background: var(--color-primary-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--box-shadow-hover) !important;
}

/* ========================================== */
/* CHARTS SECTION — FULLY RESPONSIVE         */
/* ========================================== */

.dmarc-report-analyzer .charts-container,
.dmarc-analyzer-wrapper .charts-container {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--spacing-md) !important;
    margin-bottom: var(--spacing-lg) !important;
    align-items: stretch !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .charts-container,
    .dmarc-analyzer-wrapper .charts-container {
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: var(--spacing-sm) !important;
    }
}

/* Individual chart container — no border / bg / shadow */
.dmarc-report-analyzer .xml-per-host-canvas-container,
.dmarc-analyzer-wrapper .xml-per-host-canvas-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
    width: 100% !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    min-height: 0 !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .xml-per-host-canvas-container,
    .dmarc-analyzer-wrapper .xml-per-host-canvas-container {
        flex: 1 1 0 !important;
        min-width: 7.5rem !important;
    }
}

/* ========================================== */
/* MOBILE COLOR ACCENT STICK                  */
/* One colored line per chart, mobile only    */
/* ========================================== */

.dmarc-report-analyzer .xml-per-host-canvas-container::before,
.dmarc-analyzer-wrapper .xml-per-host-canvas-container::before {
    content: '' !important;
    display: block !important;
    width: 100% !important;
    height: 4px !important;
    border-radius: 999px !important;
    margin-bottom: 0.75rem !important;
}

/* Hide accent stick on tablet+ — donut circles visible there */
@media (min-width: 48em) {
    .dmarc-report-analyzer .xml-per-host-canvas-container::before,
    .dmarc-analyzer-wrapper .xml-per-host-canvas-container::before {
        display: none !important;
    }
}

/* ---- CANVAS WRAP: hidden mobile, shown tablet+ ---- */
.dmarc-report-analyzer .chart-canvas-wrap,
.dmarc-analyzer-wrapper .chart-canvas-wrap {
    display: none !important;
    width: 100% !important;
    max-width: 7.5rem !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 auto var(--spacing-xs) auto !important;
    position: relative !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .chart-canvas-wrap,
    .dmarc-analyzer-wrapper .chart-canvas-wrap {
        display: block !important;
    }
}

.dmarc-report-analyzer .xml-per-host-canvas-container canvas,
.dmarc-analyzer-wrapper .xml-per-host-canvas-container canvas {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
}

/* ---- MOBILE PROGRESS BAR WRAP: shown mobile, hidden tablet+ ---- */
.dmarc-report-analyzer .chart-progress-wrap,
.dmarc-analyzer-wrapper .chart-progress-wrap {
    display: block !important;
    width: 100% !important;
    margin-bottom: var(--spacing-xs) !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .chart-progress-wrap,
    .dmarc-analyzer-wrapper .chart-progress-wrap {
        display: none !important;
    }
}

/* Labels row — ABOVE the bar */
.dmarc-report-analyzer .chart-progress-labels,
.dmarc-analyzer-wrapper .chart-progress-labels {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 0.4rem !important;
}

.dmarc-report-analyzer .progress-pass,
.dmarc-analyzer-wrapper .progress-pass {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    font-family: 'Muli', sans-serif !important;
}

.dmarc-report-analyzer .progress-pass .label-text,
.dmarc-analyzer-wrapper .progress-pass .label-text {
    font-weight: 400 !important;
    color: var(--color-text) !important;
    font-size: 0.6875rem !important;
    margin-bottom: 0.1rem !important;
}

.dmarc-report-analyzer .progress-pass .label-pct,
.dmarc-analyzer-wrapper .progress-pass .label-pct {
    font-weight: 700 !important;
    color: var(--color-text) !important;
    font-size: var(--font-size-sm) !important;
}

.dmarc-report-analyzer .progress-fail,
.dmarc-analyzer-wrapper .progress-fail {
    color: var(--color-text) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    font-family: 'Muli', sans-serif !important;
}

.dmarc-report-analyzer .progress-fail .label-text,
.dmarc-analyzer-wrapper .progress-fail .label-text {
    font-weight: 400 !important;
    color: var(--color-text) !important;
    font-size: 0.6875rem !important;
    margin-bottom: 0.1rem !important;
}

.dmarc-report-analyzer .progress-fail .label-pct,
.dmarc-analyzer-wrapper .progress-fail .label-pct {
    font-weight: 700 !important;
    color: var(--color-error) !important;
    font-size: var(--font-size-sm) !important;
}

/* Progress bar track */
.dmarc-report-analyzer .chart-progress-bar,
.dmarc-analyzer-wrapper .chart-progress-bar {
    position: relative !important;
    width: 100% !important;
    height: 5px !important;
    background: #EBEDF2 !important;
    border-radius: 999px !important;
    overflow: hidden !important;
}

/* Progress bar fill — background set dynamically by JS */
.dmarc-report-analyzer .chart-progress-fill,
.dmarc-analyzer-wrapper .chart-progress-fill {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    height: 100% !important;
    border-radius: 999px !important;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
    min-width: 2px !important;
    width: 0%;
}

/* Chart description block */
.dmarc-report-analyzer .chart-desc-block,
.dmarc-analyzer-wrapper .chart-desc-block {
    text-align: center !important;
    margin-top: var(--spacing-xs) !important;
    width: 100% !important;
}

.dmarc-report-analyzer .chart-header,
.dmarc-analyzer-wrapper .chart-header {
    font-family: 'Muli', sans-serif !important;
    font-weight: 600 !important;
    font-size: var(--font-size-sm) !important;
    color: var(--color-text-dark) !important;
    display: block !important;
    margin-bottom: 0.25rem !important;
    font-style: normal !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .chart-header,
    .dmarc-analyzer-wrapper .chart-header {
        font-size: var(--font-size-base) !important;
    }
}

.dmarc-report-analyzer .chart-desc-block span:not(.chart-header),
.dmarc-analyzer-wrapper .chart-desc-block span:not(.chart-header) {
    font-family: 'Muli', sans-serif !important;
    font-weight: 400 !important;
    font-size: 0.6875rem !important;
    color: var(--color-text) !important;
    display: block !important;
    line-height: 1.4 !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .chart-desc-block span:not(.chart-header),
    .dmarc-analyzer-wrapper .chart-desc-block span:not(.chart-header) {
        font-size: var(--font-size-sm) !important;
    }
}

/* ========================================== */
/* FLEX ORDER — mobile vs tablet+             */
/* ========================================== */

/* Mobile: desc-block ABOVE progress bar */
.dmarc-report-analyzer .chart-desc-block,
.dmarc-analyzer-wrapper .chart-desc-block {
    order: 1 !important;
}

.dmarc-report-analyzer .chart-progress-wrap,
.dmarc-analyzer-wrapper .chart-progress-wrap {
    order: 2 !important;
}

/* Tablet+: canvas → desc → (progress hidden) */
@media (min-width: 48em) {
    .dmarc-report-analyzer .chart-canvas-wrap,
    .dmarc-analyzer-wrapper .chart-canvas-wrap {
        order: 1 !important;
    }

    .dmarc-report-analyzer .chart-desc-block,
    .dmarc-analyzer-wrapper .chart-desc-block {
        order: 2 !important;
    }

    .dmarc-report-analyzer .chart-progress-wrap,
    .dmarc-analyzer-wrapper .chart-progress-wrap {
        order: 3 !important;
    }
}

/* ========================================== */
/* HEADINGS                                   */
/* ========================================== */

.dmarc-report-analyzer h4,
.dmarc-analyzer-wrapper h4 {
    font-family: 'Muli', sans-serif !important;
    font-size: var(--font-size-md) !important;
    font-weight: 700 !important;
    color: var(--color-text-dark) !important;
    margin: 0 0 var(--spacing-sm) 0 !important;
    font-style: normal !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer h4,
    .dmarc-analyzer-wrapper h4 {
        font-size: var(--font-size-lg) !important;
    }
}

/* ========================================== */
/* TABLES — REPORT & POLICY DETAILS          */
/* ========================================== */

.dmarc-analyzer-wrapper .xml-dmarc-report-details,
.dmarc-analyzer-wrapper .xml-policy-details {
    width: 100% !important;
    margin: 0 0 var(--spacing-md) 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 0.5px solid var(--color-border) !important;
    border-radius: 0.5625rem !important;
    overflow: hidden !important;
    background: white !important;
    table-layout: fixed !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

@media (min-width: 48em) {
    .dmarc-analyzer-wrapper .xml-dmarc-report-details,
    .dmarc-analyzer-wrapper .xml-policy-details {
        margin: 0 0 var(--spacing-lg) 0 !important;
    }
}

.dmarc-analyzer-wrapper .xml-dmarc-report-details td,
.dmarc-analyzer-wrapper .xml-policy-details td {
    padding: 0.625rem 0.75rem !important;
    font-family: 'Muli', sans-serif !important;
    font-size: 0.6875rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    color: #595d6e !important;
    border: none !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    vertical-align: top !important;
}

@media (min-width: 48em) {
    .dmarc-analyzer-wrapper .xml-dmarc-report-details td,
    .dmarc-analyzer-wrapper .xml-policy-details td {
        padding: 0.75rem 1rem !important;
        font-size: var(--font-size-sm) !important;
    }
}

@media (min-width: 64em) {
    .dmarc-analyzer-wrapper .xml-dmarc-report-details td,
    .dmarc-analyzer-wrapper .xml-policy-details td {
        font-size: var(--font-size-base) !important;
    }
}

.dmarc-analyzer-wrapper .xml-dmarc-report-details tr:not(:last-child) td,
.dmarc-analyzer-wrapper .xml-policy-details tr:not(:last-child) td {
    border-bottom: 0.5px solid var(--color-border) !important;
}

.dmarc-analyzer-wrapper .xml-dmarc-report-details td:first-child,
.dmarc-analyzer-wrapper .xml-policy-details td:first-child {
    width: 38% !important;
    font-weight: 600 !important;
    color: var(--color-text) !important;
    background: var(--color-bg-light) !important;
    font-style: normal !important;
}

@media (min-width: 48em) {
    .dmarc-analyzer-wrapper .xml-dmarc-report-details td:first-child,
    .dmarc-analyzer-wrapper .xml-policy-details td:first-child {
        width: 42% !important;
    }
}

@media (min-width: 64em) {
    .dmarc-analyzer-wrapper .xml-dmarc-report-details td:first-child,
    .dmarc-analyzer-wrapper .xml-policy-details td:first-child {
        width: 45% !important;
    }
}

/* ========================================== */
/* CATEGORY TABS                              */
/* ========================================== */

.dmarc-report-analyzer .category-tabs-section {
    margin-top: var(--spacing-lg) !important;
    padding: var(--spacing-sm) !important;
    background: white !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--box-shadow) !important;
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .category-tabs-section {
        padding: var(--spacing-md) !important;
    }
}

.dmarc-report-analyzer .category-tabs {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--spacing-sm) !important;
    margin: var(--spacing-md) 0 !important;
}

@media (min-width: 36em) {
    .dmarc-report-analyzer .category-tabs {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }
}

.dmarc-report-analyzer .tab-btn {
    font-family: 'Muli' !important;
    flex: 1 1 100% !important;
    min-width: 100% !important;
    padding: 0.875rem var(--spacing-md) !important;
    background: white !important;
    border: 2px solid #EBEDF2 !important;
    border-radius: var(--border-radius) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-weight: 400 !important;
    color: var(--color-text) !important;
}

@media (min-width: 36em) {
    .dmarc-report-analyzer .tab-btn {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-width: calc(50% - 0.5rem) !important;
    }
}

@media (min-width: 48em) {
    .dmarc-report-analyzer .tab-btn {
        border-radius: 12px !important;
        border-width: 1px !important;
        flex: 1 1 auto !important;
        min-width: 12.5rem !important;
        padding: var(--spacing-sm) var(--spacing-md) !important;
    }
}

.dmarc-report-analyzer .tab-btn:hover {
    border-color: var(--color-primary) !important;
}

.dmarc-report-analyzer .tab-btn.active {
    border-color: var(--color-primary) !important;
    background: #F0F3FF !important;
    color: var(--color-primary) !important;
}

.dmarc-report-analyzer .tab-badge {
    background: #EBEDF2 !important;
    color: var(--color-text-dark) !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 0.75rem !important;
    font-weight: 600 !important;
    font-size: var(--font-size-sm) !important;
}

.dmarc-report-analyzer .tab-btn.active .tab-badge {
    background: var(--color-primary) !important;
    color: white !important;
}

/* ========================================== */
/* EMAIL MODAL                                */
/* ========================================== */

.dmarc-report-analyzer .email-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    /* NO display:flex here — JS controls visibility */
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    padding: var(--spacing-md) !important;
}

/* Only show as flex when JS explicitly opens it */
.dmarc-report-analyzer .email-modal[style*="display: flex"],
.dmarc-report-analyzer .email-modal[style*="display:flex"] {
    display: flex !important;
}

.dmarc-report-analyzer .modal-content {
    background: white !important;
    border-radius: var(--border-radius-lg) !important;
    max-width: 31.25rem !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow: auto !important;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

.dmarc-report-analyzer .modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: var(--spacing-md) !important;
    border-bottom: 1px solid #EBEDF2 !important;
}

@media (min-width: 36em) {
    .dmarc-report-analyzer .modal-header {
        padding: var(--spacing-md) var(--spacing-lg) !important;
    }
}

.dmarc-report-analyzer .modal-header h3 {
    font-family: 'Muli' !important;
    margin: 0 !important;
    font-size: var(--font-size-lg) !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
}

.dmarc-report-analyzer .modal-body {
    padding: var(--spacing-md) !important;
}

@media (min-width: 36em) {
    .dmarc-report-analyzer .modal-body {
        padding: var(--spacing-lg) !important;
    }
}

.dmarc-report-analyzer .form-control {
    font-family: 'Muli' !important;
    width: 100% !important;
    padding: 0.75rem !important;
    border: 2px solid #EBEDF2 !important;
    border-radius: var(--border-radius) !important;
    font-size: var(--font-size-md) !important;
    transition: border-color 0.3s ease !important;
}

.dmarc-report-analyzer .form-control:focus {
    outline: none !important;
    border-color: #5867DD !important;
}

.dmarc-report-analyzer .btn-send-email {
    font-family: 'Muli' !important;
    background: var(--color-primary) !important;
    color: white !important;
    border: none !important;
    padding: 0.75rem var(--spacing-md) !important;
    border-radius: var(--border-radius) !important;
    font-weight: 400 !important;
    font-size: var(--font-size-md) !important;
    cursor: pointer !important;
    width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--spacing-xs) !important;
    transition: all 0.3s ease !important;
}

.dmarc-report-analyzer .btn-send-email:hover {
    background: var(--color-primary-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--box-shadow-hover) !important;
}

/* ========================================== */
/* PRINT STYLES                               */
/* ========================================== */

@media print {
    .dmarc-report-analyzer .results-actions,
    .dmarc-report-analyzer .email-modal,
    .dmarc-report-analyzer .loading-overlay {
        display: none !important;
    }

    .dmarc-report-analyzer .xml-per-host-canvas-container::before {
        display: none !important;
    }
}

/* ========================================== */
/* ACCESSIBILITY                              */
/* ========================================== */

.dmarc-report-analyzer *:focus-visible {
    outline: 2px solid var(--color-primary) !important;
    outline-offset: 2px !important;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

@media (max-width: 576px) {
    .dmarc-report-analyzer .btn-action {
        max-width: 15rem;
        margin: 0 auto;
    }
}