:root {
    --blue: #235FF8;
    --deep: #0B1B42;
    --sky: #E1F5FC;
    --tangelo: #F15624;
    --gray: #56668C;
    --sunglow: #FFCF30;
    --success: #218739;
    --success-light: #E8F5EC;
    --light: #f7f9fc;
    --border: #d8dfec;
}

* { box-sizing: border-box; }

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--deep);
    background: var(--light);
}

.page {
    max-width: 1600px;
    width: min(1600px, calc(100vw - 48px));
    margin: 0 auto;
    padding: 32px 0 64px;
}

.hero {
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 13px;
}

h1, h2 {
    margin: 0 0 12px;
}

.hero p:last-child {
    margin: 0;
    color: var(--gray);
}

.card, .notice {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 8px 22px rgba(11, 27, 66, .06);
}

.card.wide {
    overflow: hidden;
}

.notice.error {
    border-left: 6px solid var(--tangelo);
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

input[type="file"] {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    background: #fff;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.small {
    font-size: 14px;
    color: var(--gray);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-grid div {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: #fbfdff;
}

.summary-grid strong,
.summary-grid span {
    display: block;
}

.summary-grid span {
    margin-top: 6px;
    color: var(--gray);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    border-bottom: 1px solid var(--border);
    padding: 10px;
    vertical-align: top;
    text-align: left;
}

.review-table th,
.review-table td {
    padding: 8px;
}

th {
    background: var(--sky);
}

pre {
    max-height: 560px;
    overflow: auto;
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.question-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    background: #fbfdff;
}

.question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.question-head h3 {
    margin: 0;
    font-size: 16px;
}

.confidence {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    background: #fff;
    color: var(--gray);
    font-size: 13px;
    white-space: nowrap;
}

.question-text {
    font-weight: 700;
    margin: 10px 0 14px;
}

.flags {
    margin: 0 0 14px;
    padding: 10px 12px 10px 30px;
    border: 1px solid #ffd8c8;
    border-radius: 10px;
    background: #fff6f2;
    color: var(--deep);
}

.compact table {
    font-size: 13px;
}

.correct-row td:first-child {
    font-weight: 700;
}

.correct-row td:nth-child(2) {
    color: var(--blue);
    font-weight: 700;
}

.notice.success {
    border-left: 6px solid var(--blue);
}

.review-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
}

.review-table {
    min-width: 1120px;
}

.review-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.review-question-row.has-flags {
    background: #fffaf7;
}

.col-num {
    width: 48px;
}

.col-type {
    width: 96px;
}

.col-confidence {
    width: 96px;
}

select,
textarea,
input[type="text"] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 10px;
    font: inherit;
    color: var(--deep);
    background: #fff;
}

textarea {
    min-width: 0;
    resize: vertical;
}

.answer-line {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.correct-control {
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
    margin: 0;
}

.correct-control input {
    width: auto;
}

.multi-correct {
    display: none;
}

.compact-flags {
    margin: 0;
    padding: 8px 8px 8px 24px;
}

.action-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

@media (max-width: 760px) {
    .action-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}

:root {
    --sunglow: #FFCF30;
    --success: #218739;
    --success-light: #E8F5EC;
}

.col-question {
    width: 38%;
}

.col-answers {
    width: 34%;
}

.col-flags {
    width: 150px;
}

.review-table .col-flags {
    max-width: 150px;
}

.flag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.review-table .flag-pills {
    margin-bottom: 0;
}

.flag-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: help;
    border: 1px solid transparent;
}

.flag-error {
    background: rgba(241, 86, 36, .12);
    border-color: var(--tangelo);
    color: var(--deep);
}

.flag-warning {
    background: rgba(255, 207, 48, .24);
    border-color: var(--sunglow);
    color: var(--deep);
}

.flag-info {
    background: rgba(35, 95, 248, .10);
    border-color: var(--blue);
    color: var(--deep);
}

.flags,
.compact-flags {
    display: none;
}

/* Checkpoint 4.8 responsive desktop grid layout */
.review-wrap {
    overflow-x: auto;
}

.review-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.review-table col.col-include { width: 54px; }
.review-table col.col-num { width: 42px; }
.review-table col.col-type { width: 84px; }
.review-table col.col-question { width: 41%; }
.review-table col.col-answers { width: 37%; }
.review-table col.col-confidence { width: 78px; }
.review-table col.col-flags { width: 126px; }

.review-table td,
.review-table th {
    overflow-wrap: anywhere;
}

.include-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--deep);
}

.include-control input {
    width: auto;
}

.review-question-row.ignored-row {
    opacity: .55;
    background: #f3f5f9 !important;
}

.review-question-row.ignored-row textarea,
.review-question-row.ignored-row input[type="text"],
.review-question-row.ignored-row select {
    background: #eef2f7;
}

.flag-pills {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.review-table .flag-pills {
    margin-bottom: 0;
}

.flag-pill {
    display: inline-flex !important;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    cursor: help;
    border: 1px solid transparent;
    white-space: normal;
}

.flag-error {
    background: #F15624 !important;
    border-color: #F15624 !important;
    color: #fff !important;
}

.flag-warning {
    background: #FFCF30 !important;
    border-color: #FFCF30 !important;
    color: #0B1B42 !important;
}

.flag-info {
    background: #235FF8 !important;
    border-color: #235FF8 !important;
    color: #fff !important;
}


@media (max-width: 1100px) {
    .page {
        width: 100%;
        padding: 24px 14px 48px;
    }

    .review-table {
        min-width: 980px;
    }
}

@media (min-width: 1500px) {
    .review-table col.col-question { width: 42%; }
    .review-table col.col-answers { width: 37%; }
    .review-table col.col-flags { width: 126px; }
}

/* Checkpoint 4.8 state/action cleanup */
.inline-clear-form {
    margin-top: 14px;
}

.button-secondary {
    background: #fff;
    color: var(--blue);
    border: 1px solid var(--blue);
}

.button-secondary:hover {
    background: var(--sky);
}

.col-include input[type="hidden"] {
    display: none;
}


/* Checkpoint 5.0 export readiness and export action state */
.readiness-card {
    border-left: 6px solid var(--sunglow);
}

.readiness-card.ready,
.readiness-card.ready_export {
    border-left-color: var(--success);
    background: var(--success-light);
    border-color: rgba(33, 135, 57, .35);
}

.readiness-card.not-ready,
.readiness-card.needs_attention {
    border-left-color: var(--tangelo);
}

.readiness-card.ready_review {
    border-left-color: var(--sunglow);
    background: #fffaf0;
    border-color: rgba(255, 207, 48, .45);
}

.readiness-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.readiness-head h2 {
    margin-bottom: 6px;
}

.readiness-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.readiness-grid div {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: #fbfdff;
}

.readiness-grid strong,
.readiness-grid span {
    display: block;
}

.readiness-grid span {
    margin-top: 4px;
    font-size: 22px;
    font-weight: 800;
}

.readiness-error { color: var(--tangelo); }
.readiness-warning { color: #9a6a00; }
.readiness-info { color: var(--blue); }


.export-form {
    margin: 0;
}

.button-export,
.button-export:hover {
    background: var(--success);
    color: #fff;
    border: 1px solid var(--success);
}

.button-disabled,
.button-disabled:hover {
    background: #eef2f7;
    color: var(--gray);
    border: 1px solid var(--border);
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .readiness-head {
        flex-direction: column;
    }

    .readiness-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Checkpoint 5.2 upload parameters and diagnostics cleanup */
.parser-settings {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
    background: #fbfdff;
}

.settings-head h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.settings-head p {
    margin: 0 0 14px;
}

.parser-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.parser-settings-grid label {
    margin: 0;
    font-size: 13px;
}

.parser-settings-grid select {
    margin-top: 6px;
}

.advanced-diagnostics {
    margin-bottom: 20px;
}

.advanced-diagnostics > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--blue);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(11, 27, 66, .06);
}

.advanced-diagnostics[open] > summary {
    margin-bottom: 14px;
}

@media (max-width: 1100px) {
    .parser-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .parser-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Checkpoint 5.2.1 top readiness action cleanup */
.readiness-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.readiness-actions .inline-clear-form,
.readiness-actions .export-form {
    margin: 0;
}


/* Checkpoint 5.3 analyze processing state */
.analyze-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 168px;
}

.analyze-button .analyze-loading {
    display: none;
}

.analyze-button.is-loading .analyze-label {
    display: none;
}

.analyze-button.is-loading .analyze-loading {
    display: inline-flex;
    align-items: center;
}

.analyze-button.is-loading,
.analyze-button:disabled {
    opacity: .85;
    cursor: wait;
}

.loading-dots span {
    display: inline-block;
    animation: loadingDotPulse 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes loadingDotPulse {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-1px); }
}

.analyze-progress {
    display: none;
    margin: 12px 0 0;
    color: var(--gray);
    font-size: 14px;
    font-weight: 700;
}

.analyze-form.is-analyzing .analyze-progress {
    display: block;
}

.analyze-form.is-analyzing .parser-settings,
.analyze-form.is-analyzing input[type="file"] {
    opacity: .7;
}

/* Checkpoint 5.3 workflow tabs and image extraction utility */
.tool-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(11, 27, 66, .05);
}

.tab-link.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.image-note {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(35, 95, 248, .25);
    border-radius: 10px;
    background: #f4f7ff;
    color: var(--blue);
}

.extract-form.is-analyzing input[type="file"] {
    opacity: .7;
}

/* Checkpoint 5.3.1a Q&A workflow polish */
.tool-tabs {
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab-link {
    gap: 8px;
    border-radius: 12px 12px 0 0;
    border-bottom: 0;
    padding: 13px 18px;
    margin-right: 6px;
    box-shadow: none;
    position: relative;
    top: 2px;
}

.tab-link.active {
    box-shadow: 0 -1px 0 #fff inset;
}

.tab-icon {
    font-size: 18px;
    line-height: 1;
}

.image-note-top {
    margin: 0 0 18px;
}

button,
.tab-link {
    letter-spacing: .01em;
}

/* Checkpoint 5.3.1b image extraction workflow and Material Symbols standard */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'liga';
}

.tab-icon,
.button-icon,
.inline-icon {
    flex: 0 0 auto;
    vertical-align: middle;
}

.inline-icon {
    font-size: 18px;
    margin-right: 4px;
    position: relative;
    top: 3px;
}

button,
.button-export,
.button-secondary,
.button-disabled,
.download-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.image-ready {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid rgba(33, 135, 57, .32);
    border-radius: 12px;
    background: var(--success-light);
    padding: 14px 16px;
    margin: 16px 0;
}

.image-ready strong {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--success);
}

.image-ready p {
    margin: 6px 0 0;
}

.download-link-button {
    background: var(--success);
    color: #fff;
    border: 1px solid var(--success);
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.download-link-button:hover,
.download-link-button:focus {
    color: #fff;
    text-decoration: none;
}

.extract-form.is-analyzing .analyze-progress {
    display: block;
}

@media (max-width: 760px) {
    .image-ready {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Checkpoint 5.3.2 guided Q&A workflow */
.workflow-steps-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 20px;
    box-shadow: 0 8px 22px rgba(11, 27, 66, .05);
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.workflow-step {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: #fbfdff;
    color: var(--gray);
}

.workflow-step strong,
.workflow-step small {
    display: block;
}

.workflow-step small {
    margin-top: 3px;
    font-size: 12px;
}

.workflow-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eef3ff;
    color: var(--blue);
    font-weight: 700;
}

.workflow-step.active {
    border-color: var(--blue);
    background: #f5f8ff;
    color: var(--deep);
}

.workflow-step.active .workflow-step-number {
    background: var(--blue);
    color: #fff;
}

.workflow-step.done {
    border-color: #b9e3c4;
    background: var(--success-light);
    color: var(--deep);
}

.workflow-step.done .workflow-step-number {
    background: var(--success);
    color: #fff;
}

.workflow-step.disabled {
    opacity: .62;
}

.review-guidance-card h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.guidance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.guidance-grid div {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: #fbfdff;
}

.guidance-grid strong,
.guidance-grid span {
    display: block;
}

.guidance-grid span {
    margin-top: 6px;
    color: var(--gray);
}

@media (max-width: 900px) {
    .workflow-steps,
    .guidance-grid {
        grid-template-columns: 1fr;
    }
}

/* Checkpoint 5.3.4 review workflow and layout polish */
.page {
    width: calc(100% - 48px);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding: 32px 0 64px;
}

.tool-tabs {
    border-bottom-color: var(--blue);
    margin-bottom: 20px;
}

.tab-link {
    border-color: var(--blue);
    border-bottom-color: transparent;
    margin-right: 6px;
    top: 2px;
}

.tab-link:not(.active) {
    background: #fff;
    color: var(--blue);
}

.tab-link.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    box-shadow: none;
}

.review-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfdff;
    padding: 12px 14px;
    margin: 14px 0 16px;
}

.review-all-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--deep);
    font-weight: 800;
}

.review-all-toggle input {
    width: auto;
}

.review-filter-empty {
    border-left: 4px solid var(--success);
    padding: 10px 12px;
    background: var(--success-light);
    border-radius: 8px;
}

.review-card:not(.show-all) .review-question-row.review-confident {
    display: none;
}

.review-question-row.review-needs-attention {
    background: #fffdf7;
}

.advanced-diagnostics .diagnostics-card {
    margin-top: 14px;
}

@media (max-width: 1100px) {
    .page {
        width: calc(100% - 32px);
        padding: 24px 0 48px;
    }
}

@media (max-width: 760px) {
    .review-filter-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}


.export-helper-text {
    margin: 6px 0 0;
    font-size: 0.88rem;
    color: #5f6470;
    max-width: 260px;
}

/* Checkpoint 5.3.9 UI/accessibility polish */
.image-note,
.image-note-top {
    border-color: rgba(241, 86, 36, .35);
    background: #fff4ef;
    color: var(--tangelo);
}

.workflow-step {
    position: relative;
    padding-right: 44px;
}

.workflow-step-copy {
    display: block;
}

.workflow-step-check {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--success);
    font-size: 24px;
}


/* Validator 1.2.2-inspired converter visual refresh
   Scope: restyle existing converter states only; no workflow/features added. */
.converter-page {
    width: min(1500px, calc(100% - 40px));
    padding: 22px 0 56px;
}

.converter-topbar {
    background: linear-gradient(135deg, #081a36, #102b54);
    color: #fff;
    border-radius: 0 0 18px 18px;
    margin: -22px calc((100vw - min(1500px, calc(100vw - 40px))) / -2) 28px;
    padding: 18px max(24px, calc((100vw - min(1500px, calc(100vw - 40px))) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: 0 18px 40px rgba(25, 42, 70, .08);
}

.converter-brand,
.converter-topbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
}

.converter-brand {
    color: #fff;
    font-size: 1.22rem;
}

.converter-brand-icon {
    font-size: 2rem;
}

.converter-topbar-button {
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
    padding: 10px 14px;
    background: rgba(255,255,255,.05);
}

.converter-hero {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(25, 42, 70, .08);
    padding: 26px 30px;
    margin-bottom: 22px;
}

.converter-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -.04em;
    margin-bottom: 8px;
}

.converter-hero p:not(.eyebrow) {
    max-width: 860px;
    color: var(--gray);
    font-size: 1.04rem;
}

.converter-page .card,
.converter-page .notice,
.converter-page .workflow-steps-card,
.converter-page .image-note {
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(25, 42, 70, .08);
}

.converter-page .tool-tabs {
    display: inline-flex;
    gap: 8px;
    border: 0;
    margin: 0 0 20px;
    background: #eaf0fb;
    padding: 6px;
    border-radius: 14px;
}

.converter-page .tab-link {
    position: static;
    margin: 0;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    background: transparent;
    color: var(--deep);
    box-shadow: none;
}

.converter-page .tab-link.active {
    background: var(--blue);
    color: #fff;
}

.converter-page .image-note-top {
    border-left: 0;
    color: var(--deep);
    background: #fff7ed;
}

.converter-page .workflow-steps-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 20px;
}

.converter-page .workflow-steps {
    gap: 12px;
}

.converter-page .workflow-step {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfdff;
    box-shadow: none;
}

.converter-page .workflow-step.active {
    border-color: rgba(35, 95, 248, .55);
    background: #f4f7ff;
}

.converter-page .workflow-step.done {
    background: var(--success-light);
    border-color: rgba(33, 135, 57, .24);
}

.converter-page .readiness-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-left: 0;
    padding: 0;
}

.converter-page .readiness-head {
    padding: 26px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.converter-page .readiness-head h2 {
    font-size: 2rem;
    letter-spacing: -.03em;
    margin-bottom: 6px;
}

.converter-page .readiness-card.needs_attention .readiness-head {
    background: linear-gradient(90deg, rgba(241, 86, 36, .10), #fff);
}

.converter-page .readiness-card.ready_review .readiness-head {
    background: linear-gradient(90deg, rgba(255, 207, 48, .16), #fff);
}

.converter-page .readiness-card.ready_export .readiness-head {
    background: linear-gradient(90deg, rgba(33, 135, 57, .12), #fff);
}

.converter-page .readiness-actions {
    flex: 0 0 auto;
}

.converter-page .readiness-grid,
.converter-page .guidance-grid,
.converter-page .summary-grid {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.converter-page .readiness-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.converter-page .readiness-grid div,
.converter-page .guidance-grid div,
.converter-page .summary-grid div {
    background: #fbfdff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.converter-page .readiness-grid strong,
.converter-page .guidance-grid strong,
.converter-page .summary-grid strong {
    color: var(--gray);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.converter-page .readiness-grid span,
.converter-page .guidance-grid span,
.converter-page .summary-grid span {
    color: var(--deep);
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
}

.converter-page .button-export,
.converter-page button,
.converter-page .download-link-button {
    border-radius: 10px;
}

.converter-page .button-secondary {
    background: #fff;
    color: var(--deep);
    border: 1px solid var(--border);
}

.converter-page .button-disabled {
    background: #e6ebf4;
    color: #778196;
}

.converter-page .review-guidance-card {
    border-color: rgba(35, 95, 248, .22);
    background: linear-gradient(180deg, #fff, #f7faff);
}

.converter-page .review-guidance-card h2 {
    font-size: 1.3rem;
}

.converter-page .parser-settings {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfdff;
    padding: 18px;
    margin-bottom: 20px;
}

.converter-page .settings-head h3 {
    margin: 0 0 6px;
}

.converter-page .parser-settings-grid {
    gap: 14px;
}

.converter-page select,
.converter-page textarea,
.converter-page input[type="text"],
.converter-page input[type="file"] {
    border-color: var(--border);
    border-radius: 10px;
}

.converter-page .review-card h2 {
    font-size: 1.6rem;
}

.converter-page .review-wrap {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: auto;
}

.converter-page .review-table {
    border: 0;
}

.converter-page .review-table th {
    background: #f2f5fb;
    color: var(--deep);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--border);
}

.converter-page .review-table td {
    border-bottom: 1px solid #e9eef7;
    vertical-align: top;
}

.converter-page .review-question-row.review-needs-attention {
    background: #fffaf0;
}

.converter-page .flag-pill {
    border-radius: 999px;
    padding: 6px 9px;
    font-size: .76rem;
}

.converter-page .advanced-diagnostics {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(25, 42, 70, .08);
    overflow: hidden;
}

.converter-page .advanced-diagnostics summary {
    padding: 18px 22px;
    cursor: pointer;
    font-weight: 800;
}

.converter-page .advanced-diagnostics > .small {
    padding: 0 22px;
}

.converter-page .diagnostics-card {
    box-shadow: none;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

.converter-page .extract-form {
    max-width: 720px;
}

.converter-page .image-ready {
    border-radius: 14px;
}

@media (max-width: 980px) {
    .converter-page .readiness-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .converter-page .readiness-actions {
        width: 100%;
    }

    .converter-page .readiness-grid,
    .converter-page .guidance-grid,
    .converter-page .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .converter-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .converter-page {
        width: min(100% - 24px, 1500px);
    }

    .converter-page .tool-tabs {
        display: grid;
        width: 100%;
    }

    .converter-page .readiness-grid,
    .converter-page .guidance-grid,
    .converter-page .summary-grid {
        grid-template-columns: 1fr;
    }
}


.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: 0 !important;
}


/* Validator 1.2.3 converter requested UI refinements */
.converter-page {
    overflow-x: hidden;
}

.converter-topbar {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(24px, calc((100vw - 1500px) / 2 + 20px));
    padding-right: max(24px, calc((100vw - 1500px) / 2 + 20px));
}

.converter-brand-icon {
    font-size: 1.85rem;
}

.converter-page .analyze-form > input[type="file"],
.converter-page .extract-form > input[type="file"] {
    margin-top: 0;
}

.parser-settings-details {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfdff;
    overflow: hidden;
}

.parser-settings-details > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 14px 16px;
    color: var(--blue);
    font-weight: 800;
    list-style: none;
}

.parser-settings-details > summary::-webkit-details-marker {
    display: none;
}

.parser-settings-details[open] > summary {
    border-bottom: 1px solid var(--border);
}

.converter-page .parser-settings-details .parser-settings {
    border: 0;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
}

.converter-page .answer-line {
    grid-template-columns: 30px minmax(0, 1fr);
}

.converter-page .correct-control {
    justify-content: center;
}

.converter-page .review-table col.col-include { width: 44px; }
.converter-page .review-table col.col-num { width: 44px; }
.converter-page .review-table col.col-type { width: 84px; }
.converter-page .review-table col.col-question { width: 41%; }
.converter-page .review-table col.col-answers { width: 36%; }
.converter-page .review-table col.col-flags { width: 230px; }

.converter-page .review-table .col-flags {
    max-width: none;
}

.converter-page .flag-pills {
    gap: 8px;
}

.converter-page .flag-pill {
    padding: 7px 10px;
    font-size: .78rem;
}

@media (max-width: 1100px) {
    .converter-page .review-table {
        min-width: 1120px;
    }
}

/* Validator 1.2.4 converter upload/review refinements */
.converter-page .converter-upload-card {
    padding: 24px;
}

.converter-page .converter-upload-card > h2 {
    margin-bottom: 16px;
}

.converter-page .converter-upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
}

.converter-page .converter-upload-primary,
.converter-page .parser-settings-panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfdff;
    padding: 22px;
}

.converter-page .upload-icon-row,
.converter-page .settings-callout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.converter-page .upload-panel-icon,
.converter-page .settings-callout > .material-symbols-outlined {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eaf1ff;
    color: var(--blue);
    flex: 0 0 auto;
}

.converter-page .upload-icon-row h3,
.converter-page .settings-callout h3 {
    margin: 0 0 6px;
    font-size: 1.12rem;
}

.converter-page .converter-upload-primary input[type="file"] {
    margin-bottom: 16px;
}

.converter-page .parser-settings-panel .parser-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.converter-page .parser-settings-panel label {
    margin: 0;
}

.converter-page .parser-settings-panel select {
    margin-top: 7px;
}

.converter-page .review-guidance-card {
    padding: 22px;
}

.converter-page .review-guidance-card p:last-child {
    margin-bottom: 0;
}

.converter-page .answer-line {
    grid-template-columns: 28px minmax(0, 1fr);
}

.converter-page .correct-control {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0;
}

.converter-page .correct-control input {
    margin: 0;
}

.converter-page .review-table th.col-include {
    color: transparent;
}

@media (max-width: 980px) {
    .converter-page .converter-upload-grid {
        grid-template-columns: 1fr;
    }
}

/* Converter visual refresh: check.php is the reference (UI only) */
.converter-page {
    --converter-shadow: 0 18px 40px rgba(25, 42, 70, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    width: min(1500px, calc(100% - 40px));
    padding-top: 22px;
}

.converter-page,
.converter-page * {
    min-width: 0;
}

.converter-topbar {
    border-radius: 0 0 18px 18px;
    box-shadow: var(--converter-shadow);
    margin-bottom: 24px;
}

.converter-brand,
.converter-topbar-button {
    font-weight: 700;
}

.converter-hero,
.converter-page .card,
.converter-page .workflow-steps-card,
.converter-page .image-note {
    border-radius: 18px;
    box-shadow: var(--converter-shadow);
}

.converter-hero {
    padding: 28px;
    margin-bottom: 20px;
}

.converter-hero h1 {
    margin-bottom: 10px;
}

.converter-page .tool-tabs {
    border-bottom: 0;
    background: #eef3fb;
    border-radius: 14px;
    padding: 5px;
    width: fit-content;
    max-width: 100%;
}

.converter-page .tab-link {
    border: 0;
    border-radius: 10px;
    top: 0;
    margin: 0;
    padding: 12px 16px;
}

.converter-page .tab-link:not(.active) {
    background: transparent;
    color: var(--deep);
}

.converter-page .workflow-steps-card {
    padding: 12px;
}

.converter-page .workflow-step {
    border-radius: 12px;
}

.converter-page .converter-upload-card {
    padding: 24px;
}

.converter-page .converter-upload-card > h2 {
    font-size: 1.55rem;
    margin-bottom: 18px;
}

.converter-page .converter-upload-grid {
    gap: 24px;
}

.converter-page .converter-upload-primary,
.converter-page .parser-settings-panel,
.converter-page .converter-simple-upload {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    padding: 24px;
    box-shadow: none;
}

.converter-page .parser-settings-panel {
    background: linear-gradient(135deg, #fff, #f1f6ff);
}

.converter-page .converter-upload-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.converter-page .converter-upload-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eaf1ff;
    color: var(--blue);
    font-size: 34px;
}

.converter-page .converter-upload-heading h3 {
    margin: 0 0 6px;
    font-size: 1.16rem;
}

.converter-page .converter-upload-heading p {
    margin: 0;
    line-height: 1.45;
}

.converter-page input[type="file"] {
    width: 100%;
    border: 1px dashed #b8c5d6;
    border-radius: 12px;
    padding: 12px;
    background: #fbfdff;
}


.converter-page .analyze-button {
    min-height: 46px;
    padding: 12px 18px;
}

.converter-page .parser-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.converter-page .parser-settings-grid label {
    margin: 0;
}

.converter-page .parser-settings-grid select {
    width: 100%;
    margin-top: 7px;
}

.converter-page .image-ready {
    border-radius: 14px;
    padding: 18px;
}

.converter-page .readiness-card {
    border-radius: 18px;
    box-shadow: var(--converter-shadow);
}

.converter-page .readiness-grid div {
    border-radius: 12px;
}

.converter-page .review-guidance-card {
    padding: 20px 22px;
}

.converter-page .review-guidance-card h2 {
    font-size: 1.22rem;
    margin-bottom: 8px;
}

.converter-page .review-card {
    padding: 22px;
}

.converter-page .review-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.converter-page .review-table {
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
}

.converter-page .review-table col.col-include { width: 42px; }
.converter-page .review-table col.col-num { width: 44px; }
.converter-page .review-table col.col-type { width: 82px; }
.converter-page .review-table col.col-question { width: 35%; }
.converter-page .review-table col.col-answers { width: 37%; }
.converter-page .review-table col.col-flags { width: 190px; }

.converter-page .review-table textarea,
.converter-page .review-table input[type="text"],
.converter-page .review-table select {
    width: 100%;
    max-width: 100%;
}

.converter-page .flag-pills {
    align-items: flex-start;
}

.converter-page .advanced-diagnostics-intro {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 22px 16px;
}

.converter-page .advanced-diagnostics-intro p {
    margin: 0;
}

.converter-page .diagnostic-checkpoint {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #eaf1ff;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

@media (max-width: 980px) {
    .converter-page .converter-upload-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .converter-page {
        width: min(100% - 24px, 1500px);
    }

    .converter-page .converter-upload-primary,
    .converter-page .parser-settings-panel,
    .converter-page .converter-simple-upload {
        padding: 18px;
    }

    .converter-page .converter-upload-icon {
        width: 52px;
        height: 52px;
        font-size: 30px;
    }
}

/* Validator 1.2.9 visual alignment fixes */
.converter-body {
    margin: 0;
    background: #f6f8fc;
    color: #111827;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.converter-body .converter-topbar {
    background: linear-gradient(135deg, #081a36, #102b54);
    color: #fff;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 18px 40px rgba(25, 42, 70, .08);
}

/* Match the native file-picker treatment used by check.php. */
.converter-page input[type="file"] {
    border: 1px dashed #b8c5d6;
    border-radius: 12px;
    padding: 14px;
    background: #fbfdff;
}

/* Give each workflow step the same breathing room as the validator cards. */
.converter-page .workflow-steps-card {
    padding: 14px;
}

.converter-page .workflow-steps {
    gap: 14px;
}

.converter-page .workflow-step {
    min-height: 76px;
    padding: 14px 46px 14px 14px;
    gap: 12px;
    align-items: center;
}

.converter-page .workflow-step-number {
    min-width: 30px;
    width: 30px;
    height: 30px;
}

.converter-page .workflow-step-copy {
    display: grid;
    gap: 4px;
}

.converter-page .workflow-step-copy strong {
    font-size: 1rem;
    line-height: 1.2;
}

.converter-page .workflow-step-copy small {
    margin: 0;
    font-size: .82rem;
    line-height: 1.35;
}


/* Build 1.2.10: cache-busted converter visual alignment. */

/* Build 1.2.11: align converter top bar and page background with check.php. */
html,
body.converter-body {
    min-height: 100%;
    background: #f6f8fc;
}

body.converter-body {
    overflow-x: hidden;
}

/* The earlier overflow rule clipped the full-bleed top bar to the page width. */
.converter-page {
    overflow: visible;
    background: #f6f8fc;
}

.converter-body .converter-topbar {
    position: relative;
    left: 50%;
    width: 100vw;
    max-width: none;
    margin-top: -22px;
    margin-right: -50vw;
    margin-left: -50vw;
    padding-right: max(24px, calc((100vw - 1500px) / 2 + 20px));
    padding-left: max(24px, calc((100vw - 1500px) / 2 + 20px));
}
