/* ==========================================================================
   WCAG REPORT
   ========================================================================== */

:root {
    --wcag-panel-bg: var(--content-background-color, #ffffff);
    --wcag-panel-text: var(--content-text-color, #1f2937);
    --wcag-border: var(--border-color, #dfe3ea);
    --wcag-subtle-border: var(--subtle-border-color, #edf1f5);

    --wcag-toolbar-bg: var(--content-background-color, #ffffff);
    --wcag-toolbar-text: var(--content-text-color, #1f2937);

    --wcag-table-head-bg: var(--table-row-header-background-color, #f6f8fb);
    --wcag-table-head-text: var(--table-row-header-text-color, #374151);
    --wcag-table-row-odd-bg: var(--table-row-background-odd, #ffffff);
    --wcag-table-row-odd-text: var(--table-row-text-odd, #1f2937);
    --wcag-table-row-even-bg: var(--table-row-background-even, #fcfcfd);
    --wcag-table-row-even-text: var(--table-row-text-even, #1f2937);
    --wcag-table-row-hover-bg: var(--table-row-background-hover, #fafbfc);
    --wcag-table-row-hover-text: var(--table-row-color-hover, #111827);

    --wcag-input-bg: var(--form-control-background-color, #ffffff);
    --wcag-input-text: var(--form-control-color, #111827);
    --wcag-input-border: var(--form-control-border-color, #cfd6df);
    --wcag-input-placeholder: var(--form-control-placeholder-color, #9ca3af);

    --wcag-title-color: var(--heading-text-color, #1f2937);
    --wcag-muted: var(--subheading-text-color, #6b7280);

    --wcag-pass: #166534;
    --wcag-fail: #991b1b;
    --wcag-partial: #92400e;
    --wcag-neutral: #6b7280;

    --wcag-pass-bg: #dcfce7;
    --wcag-fail-bg: #fee2e2;
    --wcag-partial-bg: #fef3c7;
    --wcag-neutral-bg: #e5e7eb;
    --wcag-level-bg: #dbeafe;
    --wcag-level-text: #1e40af;
}

body.dark-mode {
    --wcag-pass: #86efac;
    --wcag-fail: #fca5a5;
    --wcag-partial: #fde68a;
    --wcag-neutral: #cbd5e1;

    --wcag-pass-bg: rgba(22, 163, 74, 0.18);
    --wcag-fail-bg: rgba(220, 38, 38, 0.18);
    --wcag-partial-bg: rgba(251, 191, 36, 0.18);
    --wcag-neutral-bg: rgba(148, 163, 184, 0.14);
    --wcag-level-bg: rgba(37, 99, 235, 0.18);
    --wcag-level-text: #c7d2fe;
}

#maincontent {
    padding: 18px 22px 22px;
    color: var(--wcag-panel-text);
}

.wcag-panel {
    width: 100%;
    color: var(--wcag-panel-text);
}

.panel-header {
    margin: 0 0 14px;
}

.panel-header h1 {
    margin: 0;
    font-size: 1.45em;
    font-weight: 700;
    color: var(--wcag-title-color);
}

.wrap {
    padding: 0;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 16px;
}

.sc {
    flex: 1 1 120px;
    min-width: 120px;
    background: var(--wcag-panel-bg);
    border: 1px solid var(--wcag-border);
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
    color: var(--wcag-panel-text);
}

.sc .n {
    font-size: 1.65em;
    font-weight: 700;
    line-height: 1.1;
}

.sc .l {
    margin-top: 4px;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--wcag-muted);
}

.cn-pass    { color: var(--wcag-pass); }
.cn-fail    { color: var(--wcag-fail); }
.cn-partial { color: var(--wcag-partial); }
.cn-grey    { color: var(--wcag-neutral); }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 10px 12px;
    background: var(--wcag-toolbar-bg);
    border: 1px solid var(--wcag-border);
    border-radius: 8px;
    color: var(--wcag-toolbar-text);
}

.toolbar input,
.toolbar select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--wcag-input-border);
    border-radius: 6px;
    background: var(--wcag-input-bg);
    color: var(--wcag-input-text);
    font-size: 13px;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
}

.toolbar input::placeholder {
    color: var(--wcag-input-placeholder);
}

.toolbar input {
    min-width: 220px;
}

.toolbar .btn,
.toolbar a.btn,
.toolbar button.btn {
    width: auto;
    flex: 0 0 auto;
}

.toolbar .rc {
    margin-left: auto;
    font-size: 12px;
    color: var(--wcag-muted);
    flex: 0 0 auto;
}

.tbl-wrap {
    background: var(--wcag-panel-bg);
    border: 1px solid var(--wcag-border);
    border-radius: 8px;
    overflow: auto;
}

.tbl-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tbl-wrap thead th {
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    font-weight: 600;
    color: var(--wcag-table-head-text);
    background: var(--wcag-table-head-bg);
    border-bottom: 1px solid var(--wcag-border);
}

.tbl-wrap tbody tr:nth-child(odd) td {
    background: var(--wcag-table-row-odd-bg);
    color: var(--wcag-table-row-odd-text);
}

.tbl-wrap tbody tr:nth-child(even) td {
    background: var(--wcag-table-row-even-bg);
    color: var(--wcag-table-row-even-text);
}

.tbl-wrap tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--wcag-subtle-border);
    vertical-align: middle;
}

.tbl-wrap tbody tr:last-child td {
    border-bottom: none;
}

.tbl-wrap tbody tr:hover td {
    background: var(--wcag-table-row-hover-bg);
    color: var(--wcag-table-row-hover-text);
}

.tbl-wrap tbody tr {
    cursor: pointer;
}

.tbl-wrap tbody tr .btn-reset {
    cursor: pointer;
}

.empty td {
    padding: 30px 12px;
    text-align: center;
    color: var(--wcag-muted);
    font-style: italic;
}

.sa {
    color: var(--wcag-muted);
    font-size: 11px;
    margin-left: 2px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.bp { background: var(--wcag-pass-bg); color: var(--wcag-pass); }
.bf { background: var(--wcag-fail-bg); color: var(--wcag-fail); }
.bw { background: var(--wcag-partial-bg); color: var(--wcag-partial); }
.be { background: var(--wcag-neutral-bg); color: var(--wcag-neutral); }
.bl { background: var(--wcag-level-bg); color: var(--wcag-level-text); }
.bn { background: var(--wcag-neutral-bg); color: var(--wcag-neutral); }

.sc-c { color: var(--wcag-fail); font-weight: 700; }
.sc-s { color: var(--wcag-partial); }
.sc-m { color: var(--wcag-panel-text); }
.sc-n { color: var(--wcag-muted); }

.btn-reset {
    width: 28px;
    height: 28px;
    border: 1px solid var(--wcag-input-border);
    border-radius: 6px;
    background: var(--wcag-input-bg);
    color: var(--wcag-input-text);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.btn-reset:hover {
    filter: brightness(1.08);
}

.overlay,
.popup {
    display: none;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 800;
}

.popup {
    position: fixed;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    width: min(95vw, 980px);
    height: 93vh;
    background: var(--popup-background-color, var(--wcag-panel-bg));
    color: var(--popup-text-color, var(--wcag-panel-text));
    border: 1px solid var(--wcag-border);
    border-radius: 10px;
    z-index: 801;
    display: flex;
    flex-direction: column;
    box-shadow: var(--popup-box-shadow, 0 8px 30px rgba(0,0,0,0.2));
}

.pop-hd {
    padding: 14px 18px;
    border-bottom: 1px solid var(--wcag-border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--wcag-table-head-bg);
    border-radius: 10px 10px 0 0;
}

.pop-hd h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pop-close {
    background: transparent;
    border: 1px solid var(--wcag-border);
    color: inherit;
    border-radius: 6px;
    cursor: pointer;
    padding: 4px 10px;
}

.pop-body {
    overflow-y: auto;
    padding: 18px;
    flex: 1;
    font-size: 14px;
}

.pop-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.pop-stats span {
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--wcag-neutral-bg);
}

.pop-url {
    margin-bottom: 14px;
}

.pop-url a,
.vc-help {
    color: var(--wcag-level-text);
}

.pop-err {
    background: var(--wcag-fail-bg);
    color: var(--wcag-fail);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--wcag-border);
    margin-bottom: 14px;
}

.tab {
    padding: 8px 14px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.tab.on {
    background: var(--wcag-panel-bg);
    border-color: var(--wcag-border);
    font-weight: 700;
}

.panel {
    display: none;
}

.panel.on {
    display: block;
}

.vc {
    border: 1px solid var(--wcag-border);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.vc-hd {
    padding: 9px 12px;
    background: var(--wcag-table-head-bg);
    border-bottom: 1px solid var(--wcag-border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vc-tags {
    color: var(--wcag-muted);
    flex: 1;
    font-size: 13px;
}

.vc-body {
    padding: 12px 14px;
}

.vc-nodes {
    margin-top: 10px;
}

.vc-node {
    background: var(--wcag-neutral-bg);
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
    font-family: var(--default-monospace, monospace);
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.vc-node small {
    display: block;
    margin-top: 6px;
    color: var(--wcag-muted);
    font-family: inherit;
    white-space: normal;
    font-size: 12px;
}

.none,
.loading {
    color: var(--wcag-muted);
}