/* =========================================================
   DISEASESMAPMX — PRRSV-2 ORF5 SEQUENCE ANALYSIS
   Page-specific styles. Existing global styles remain intact.
   ========================================================= */

.analysis-hero {
    position: relative;
    padding: 92px 20px;
    overflow: hidden;
}

.analysis-hero::after {
    content: "";
    position: absolute;
    inset: auto -130px -180px auto;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    box-shadow:
        0 0 0 55px rgba(255, 255, 255, 0.03),
        0 0 0 110px rgba(255, 255, 255, 0.02);
    pointer-events: none;
}

.analysis-eyebrow,
.analysis-section-label {
    margin: 0 0 8px;
    color: #1d4ed8;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.analysis-hero .analysis-eyebrow {
    color: #93c5fd;
}

.analysis-hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.analysis-hero-badges span {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    color: #f8fafc;
    font-size: 0.86rem;
    font-weight: 700;
    backdrop-filter: blur(5px);
}

.analysis-language-status span {
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.85;
}

.analysis-intro {
    padding: 44px 40px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.analysis-intro-content {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 34px;
    align-items: center;
    max-width: 1320px;
    margin: auto;
}

.analysis-intro h2,
.analysis-workflow-section h2 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    line-height: 1.2;
}

.analysis-intro p,
.analysis-workflow-section p {
    margin: 0;
    color: #475569;
    font-size: 1.03rem;
    line-height: 1.75;
}

.analysis-status-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
}

.analysis-status-card strong {
    display: block;
    margin-bottom: 5px;
    color: #1e3a8a;
}

.analysis-status-card p {
    color: #1e40af;
    font-size: 0.92rem;
    line-height: 1.55;
}

.analysis-status-dot {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    margin-top: 5px;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.13);
}

.analysis-shell {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(290px, 0.78fr);
    gap: 28px;
    align-items: start;
    max-width: 1440px;
    margin: auto;
    padding: 42px 40px 58px;
}

.analysis-main-column,
.analysis-sidebar {
    min-width: 0;
}

.analysis-form {
    display: grid;
    gap: 24px;
}

.analysis-panel,
.analysis-side-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
}

.analysis-panel {
    padding: 30px;
}

.analysis-panel-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.analysis-panel-header h3,
.analysis-side-card h3 {
    margin: 0;
    color: #0f172a;
    line-height: 1.25;
}

.analysis-panel-header h3 {
    font-size: 1.55rem;
}

.analysis-panel-header p:not(.analysis-section-label) {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 0.94rem;
    line-height: 1.55;
}

.analysis-step-number {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #e0e7ff;
    color: #1d4ed8;
    font-size: 1rem;
    font-weight: 800;
}

.analysis-step-result {
    background: #dcfce7;
    color: #047857;
}

.analysis-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.analysis-field {
    min-width: 0;
}

.analysis-field-wide {
    grid-column: 1 / -1;
}

.analysis-field label,
.analysis-label-row label {
    display: block;
    margin-bottom: 8px;
    color: #1e293b;
    font-size: 0.92rem;
    font-weight: 750;
}

.analysis-field label span,
.analysis-label-row label span {
    color: #b91c1c;
}

.analysis-field input,
.analysis-field select,
.analysis-field textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.analysis-field input,
.analysis-field select {
    min-height: 46px;
    padding: 10px 12px;
}

.analysis-field textarea {
    min-height: 290px;
    padding: 16px;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.55;
    letter-spacing: 0.02em;
}

.analysis-field input:hover,
.analysis-field select:hover,
.analysis-field textarea:hover {
    border-color: #94a3b8;
}

.analysis-field input:focus,
.analysis-field select:focus,
.analysis-field textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.analysis-field input[aria-invalid="true"],
.analysis-field select[aria-invalid="true"],
.analysis-field textarea[aria-invalid="true"] {
    border-color: #dc2626;
    background: #fffafa;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}

.analysis-field small {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-size: 0.79rem;
    line-height: 1.45;
}

.analysis-fixed-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.analysis-fixed-fields div {
    padding: 15px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
}

.analysis-fixed-fields span,
.analysis-result-card span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.analysis-fixed-fields strong {
    color: #1e3a8a;
}

.analysis-label-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.analysis-counter {
    padding: 5px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
}

.analysis-sequence-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.analysis-inline-feedback {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.55;
}

.analysis-inline-feedback.is-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.analysis-inline-feedback.is-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.analysis-inline-feedback.is-valid {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.analysis-consent-list {
    display: grid;
    gap: 13px;
}

.analysis-checkbox-card {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.analysis-checkbox-card:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.analysis-checkbox-card input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #2563eb;
}

.analysis-checkbox-card strong,
.analysis-checkbox-card small {
    display: block;
}

.analysis-checkbox-card strong {
    color: #1e293b;
    font-size: 0.92rem;
    line-height: 1.4;
}

.analysis-checkbox-card small {
    margin-top: 5px;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.5;
}

.analysis-submit-bar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 22px 24px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
}

.analysis-submit-bar strong {
    font-size: 1rem;
}

.analysis-submit-bar p {
    margin: 5px 0 0;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.analysis-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 9px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.analysis-button:hover {
    transform: translateY(-1px);
}

.analysis-button-primary {
    min-width: 220px;
    border: 1px solid #3b82f6;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.30);
}

.analysis-button-primary:hover {
    background: #1d4ed8;
}

.analysis-button-secondary {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.analysis-button-ghost {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
}

.analysis-button:focus-visible,
.analysis-checkbox-card:focus-within {
    outline: 3px solid rgba(37, 99, 235, 0.26);
    outline-offset: 2px;
}

.analysis-form-message {
    display: none;
    padding: 14px 16px;
    border-radius: 11px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.analysis-form-message.is-visible {
    display: block;
}

.analysis-form-message.is-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.analysis-form-message.is-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.analysis-sidebar {
    display: grid;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.analysis-side-card {
    padding: 24px;
}

.analysis-side-card h3 {
    margin-bottom: 14px;
    font-size: 1.22rem;
}

.analysis-side-card p {
    margin: 0 0 13px;
    color: #475569;
    font-size: 0.91rem;
    line-height: 1.65;
}

.analysis-side-card p:last-child {
    margin-bottom: 0;
}

.analysis-side-card-accent {
    border-top: 5px solid #047857;
    background: linear-gradient(180deg, #ffffff 0%, #f5fffb 100%);
}

.analysis-check-list {
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.analysis-check-list li {
    position: relative;
    padding-left: 25px;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.5;
}

.analysis-check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #dcfce7;
    color: #047857;
    font-size: 0.72rem;
    font-weight: 900;
}

.analysis-requirements {
    display: grid;
    gap: 0;
    margin: 0;
}

.analysis-requirements div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 0;
    border-bottom: 1px solid #e5e7eb;
}

.analysis-requirements div:last-child {
    border-bottom: 0;
}

.analysis-requirements dt {
    color: #64748b;
    font-size: 0.85rem;
}

.analysis-requirements dd {
    margin: 0;
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 800;
    text-align: right;
}


/* v3.4.4 — Keep post-analysis workflow hidden until an analysis has been executed. */

/* v3.5.3 — enforce hidden state for low-identity stop workflow.
   Some grid/flex display rules can override the browser default [hidden] behavior.
   This keeps the blocked workflow visually clean: warning box only. */
.analysis-screening-step [hidden],
.analysis-result-grid[hidden],
.analysis-api-output[hidden],
.analysis-workflow-note[hidden],
.analysis-results-step[hidden],
.analysis-report-step[hidden],
#treeContextSection[hidden],
#proteinAnalysisSection[hidden] {
    display: none !important;
}

.analysis-results[hidden],
#analysisResults[hidden] {
    display: none !important;
}

.analysis-results {
    display: grid;
    gap: 24px;
    margin-top: 24px;
    scroll-margin-top: 24px;
}

.analysis-results-step {
    scroll-margin-top: 24px;
}

.analysis-workflow-note {
    margin-bottom: 22px;
    padding: 15px 16px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
}

.analysis-workflow-note strong {
    display: block;
    margin-bottom: 5px;
    color: #1e3a8a;
    font-size: 0.9rem;
}

.analysis-workflow-note p {
    margin: 0;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.55;
}

.analysis-workflow-note-tree {
    border-color: #ddd6fe;
    background: #fbfaff;
}

.analysis-step-tree {
    background: #ede9fe;
    color: #6d28d9;
}

.analysis-step-report {
    background: #e0f2fe;
    color: #0369a1;
}

.analysis-report-step .analysis-report-actions {
    margin: 0;
}

.analysis-report-step .analysis-json-details {
    margin-top: 18px;
}

.analysis-result-alert {
    padding: 16px 18px;
    border-radius: 12px;
    margin-bottom: 22px;
}

.analysis-result-alert strong {
    display: block;
    margin-bottom: 4px;
}

.analysis-result-alert p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
}

.analysis-report-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 22px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.analysis-report-actions small {
    flex: 1 1 260px;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.45;
}

.analysis-result-alert-info {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.analysis-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.analysis-result-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
}

.analysis-result-card strong {
    display: block;
    margin-bottom: 7px;
    color: #0f172a;
    font-size: 1.35rem;
    overflow-wrap: anywhere;
}

.analysis-result-card small {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.4;
}

.analysis-classification-placeholder {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(210px, 0.6fr);
    gap: 22px;
    align-items: center;
    margin-top: 20px;
    padding: 24px;
    border: 1px dashed #94a3b8;
    border-radius: 14px;
    background: #fbfdff;
}

.analysis-placeholder-label {
    display: inline-block;
    margin-bottom: 8px;
    color: #7c3aed;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.analysis-classification-placeholder h4 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.25rem;
}

.analysis-classification-placeholder p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
}

.analysis-placeholder-tree {
    position: relative;
    min-height: 150px;
    border-left: 3px solid #94a3b8;
}

.analysis-placeholder-tree span {
    position: absolute;
    left: 0;
    display: block;
    width: 70%;
    height: 2px;
    background: #94a3b8;
}

.analysis-placeholder-tree span::after {
    content: "";
    position: absolute;
    right: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7c3aed;
}

.analysis-placeholder-tree span:nth-child(1) { top: 14%; width: 48%; }
.analysis-placeholder-tree span:nth-child(2) { top: 32%; width: 78%; }
.analysis-placeholder-tree span:nth-child(3) { top: 50%; width: 58%; }
.analysis-placeholder-tree span:nth-child(4) { top: 68%; width: 88%; }
.analysis-placeholder-tree span:nth-child(5) { top: 86%; width: 68%; }

.analysis-workflow-section {
    padding: 66px 40px;
    border-top: 1px solid #dbeafe;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.analysis-workflow-content {
    max-width: 1320px;
    margin: auto;
    text-align: center;
}

.analysis-workflow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 34px;
    text-align: left;
}

.analysis-workflow-grid article {
    padding: 24px;
    border: 1px solid #dbeafe;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 5px 16px rgba(30, 64, 175, 0.06);
}

.analysis-workflow-grid article > span {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 900;
}

.analysis-workflow-grid h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.12rem;
}

.analysis-workflow-grid p {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.6;
}

@media (max-width: 1120px) {
    .analysis-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .analysis-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        position: static;
    }

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

@media (max-width: 800px) {
    .analysis-intro {
        padding: 36px 20px;
    }

    .analysis-intro-content {
        grid-template-columns: 1fr;
    }

    .analysis-shell {
        padding: 28px 18px 44px;
    }

    .analysis-panel {
        padding: 22px;
    }

    .analysis-form-grid,
    .analysis-sidebar,
    .analysis-fixed-fields,
    .analysis-classification-placeholder {
        grid-template-columns: 1fr;
    }

    .analysis-field-wide {
        grid-column: auto;
    }

    .analysis-submit-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .analysis-button-primary {
        width: 100%;
    }

    .analysis-workflow-section {
        padding: 50px 18px;
    }
}

@media (max-width: 560px) {
    .analysis-hero {
        padding: 58px 16px;
    }

    .analysis-hero-badges {
        gap: 7px;
    }

    .analysis-hero-badges span {
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    .analysis-panel {
        padding: 17px;
        border-radius: 14px;
    }

    .analysis-panel-header {
        gap: 12px;
    }

    .analysis-step-number {
        width: 36px;
        height: 36px;
    }

    .analysis-panel-header h3 {
        font-size: 1.3rem;
    }

    .analysis-field textarea {
        min-height: 250px;
        font-size: 0.82rem;
    }

    .analysis-sequence-tools {
        display: grid;
    }

    .analysis-button {
        width: 100%;
    }

    .analysis-result-grid,
    .analysis-workflow-grid {
        grid-template-columns: 1fr;
    }

    .analysis-side-card {
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .analysis-button,
    .analysis-field input,
    .analysis-field select,
    .analysis-field textarea,
    .analysis-checkbox-card {
        transition: none;
    }
}


/* ====================== */
/* REFERENCE SCREENING RESULT OUTPUT */
/* ====================== */

.analysis-result-alert-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.analysis-result-alert-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.analysis-result-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.analysis-api-summary-grid {
    margin-top: 14px;
}

.analysis-lineage-card {
    border-top: 5px solid #047857;
    background: #f7fffb;
}

.analysis-lineage-card strong {
    color: #047857;
    font-size: 1.7rem;
}

.analysis-api-output {
    margin-top: 20px;
    padding: 24px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #fbfdff;
}

.analysis-api-output-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.analysis-api-output h4 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.25rem;
}

.analysis-api-output p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
}

.analysis-match-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.analysis-match-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.analysis-match-table th,
.analysis-match-table td {
    padding: 12px 13px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.analysis-match-table th {
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.analysis-match-table tr:last-child td {
    border-bottom: 0;
}

.analysis-match-table td:nth-child(1),
.analysis-match-table td:nth-child(4),
.analysis-match-table td:nth-child(5) {
    font-weight: 800;
    white-space: nowrap;
}

.analysis-json-details {
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.analysis-json-details summary {
    padding: 13px 15px;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
}

.analysis-json-details pre {
    max-height: 360px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    border-top: 1px solid #e2e8f0;
    background: #0f172a;
    color: #e2e8f0;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    line-height: 1.55;
}

.analysis-button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

@media (max-width: 800px) {
    .analysis-api-output {
        padding: 18px;
    }

    .analysis-api-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ====================== */
/* V3 MICRO-ADJUSTMENTS */
/* ====================== */

.analysis-api-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.analysis-lineage-card-success {
    border-top-color: #047857;
    background: #f7fffb;
}

.analysis-lineage-card-success strong {
    color: #047857;
}

.analysis-lineage-card-warning {
    border-top-color: #d97706;
    background: #fffbeb;
}

.analysis-lineage-card-warning strong {
    color: #92400e;
}

.analysis-lineage-card-neutral {
    border-top-color: #64748b;
    background: #f8fafc;
}

.analysis-lineage-card-neutral strong {
    color: #334155;
}

.analysis-orientation-card {
    border-top: 5px solid #2563eb;
    background: #f8fbff;
}

.analysis-orientation-card strong {
    color: #1d4ed8;
    font-size: 1.35rem;
}


/* =========================================================
   Master tree context — v3.2
   ========================================================= */

.analysis-tree-context {
    border-color: #c4b5fd;
    background: linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
}

.analysis-tree-context-grid {
    margin-top: 18px;
}

.analysis-tree-neighborhood {
    margin-top: 22px;
}

.analysis-tree-neighborhood h5 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 1rem;
}

.analysis-tree-neighborhood p {
    margin: 0 0 14px;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.55;
}

.analysis-tree-neighborhood-table td,
.analysis-tree-neighborhood-table th {
    white-space: nowrap;
}

.analysis-tree-best-match-row {
    background: #eff6ff;
    font-weight: 800;
}

.analysis-tree-best-match-row td:first-child {
    color: #1d4ed8;
}


/* =========================================================
   Master tree local SVG visualization — v3.3
   ========================================================= */

.analysis-tree-graphic {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.analysis-tree-graphic-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.analysis-tree-graphic-header h5 {
    margin: 0 0 5px;
    color: #0f172a;
    font-size: 1rem;
}

.analysis-tree-graphic-header p {
    margin: 0;
    color: #475569;
    font-size: 0.86rem;
    line-height: 1.5;
}

#treeGraphicBadge {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 0.76rem;
    font-weight: 850;
    white-space: nowrap;
}

.analysis-tree-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 14px;
}

.analysis-tree-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 750;
}

.analysis-tree-legend-item i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.analysis-tree-legend-item small {
    color: #64748b;
    font-weight: 800;
}

.analysis-tree-svg-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.analysis-tree-svg {
    display: block;
    min-width: 780px;
    max-width: none;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.analysis-tree-root-line {
    stroke: #cbd5e1;
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.analysis-tree-segment {
    stroke: #94a3b8;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.analysis-tree-tip-dot {
    stroke: #ffffff;
    stroke-width: 1.8;
}

.analysis-tree-tip-label {
    fill: #0f172a;
    font-size: 12px;
    font-weight: 750;
}

.analysis-tree-tip-sublabel {
    fill: #64748b;
    font-size: 10px;
    font-weight: 650;
}

.analysis-tree-tip-best .analysis-tree-tip-label {
    fill: #1d4ed8;
    font-weight: 900;
}

.analysis-tree-tip-best .analysis-tree-tip-dot {
    stroke: #1d4ed8;
    stroke-width: 2.4;
}

.analysis-tree-color-0 { fill: #2563eb; background: #2563eb; }
.analysis-tree-color-1 { fill: #059669; background: #059669; }
.analysis-tree-color-2 { fill: #dc2626; background: #dc2626; }
.analysis-tree-color-3 { fill: #7c3aed; background: #7c3aed; }
.analysis-tree-color-4 { fill: #ea580c; background: #ea580c; }
.analysis-tree-color-5 { fill: #0891b2; background: #0891b2; }
.analysis-tree-color-6 { fill: #be123c; background: #be123c; }
.analysis-tree-color-7 { fill: #4f46e5; background: #4f46e5; }
.analysis-tree-color-8 { fill: #65a30d; background: #65a30d; }
.analysis-tree-color-9 { fill: #9333ea; background: #9333ea; }
.analysis-tree-color-10 { fill: #0d9488; background: #0d9488; }
.analysis-tree-color-11 { fill: #ca8a04; background: #ca8a04; }

/* Keep raw JSON from expanding the grid/sidebar layout. */
.analysis-main-column,
.analysis-results,
.analysis-results-step,
.analysis-report-step,
.analysis-json-details {
    min-width: 0;
    max-width: 100%;
}

.analysis-json-details {
    overflow: hidden;
}

.analysis-json-details pre {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: auto;
}

@media (max-width: 800px) {
    .analysis-tree-graphic-header {
        flex-direction: column;
    }

    #treeGraphicBadge {
        align-self: flex-start;
    }

    .analysis-tree-svg {
        min-width: 720px;
    }
}

/* =========================================================
   Final UX polish — v3.4
   ========================================================= */

.analysis-button-pdf {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.analysis-button-pdf:hover {
    background: #ede9fe;
}

.analysis-report-actions {
    align-items: center;
}

.analysis-report-actions .analysis-button {
    flex: 0 0 auto;
}

.analysis-tree-graphic-header h5,
.analysis-tree-neighborhood h5 {
    letter-spacing: -0.01em;
}

.analysis-tree-neighborhood p,
.analysis-tree-graphic-header p {
    max-width: 820px;
}

/* Keep the raw JSON viewer contained in both browser and print views. */
.analysis-json-details {
    max-width: 100%;
    contain: inline-size;
}

.analysis-json-details pre {
    display: block;
    box-sizing: border-box;
    inline-size: 100%;
    max-inline-size: 100%;
    max-height: 420px;
    overflow: auto;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}

@media print {
    .analysis-json-details[open] pre {
        max-height: 260px;
    }

    .analysis-button,
    .analysis-sequence-tools,
    .analysis-submit-bar {
        box-shadow: none !important;
    }
}


/* v3.4.5 — Advanced technical JSON output note */
.analysis-json-note {
    margin: 12px 0 12px;
    padding: 13px 14px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
    color: #334155;
}

.analysis-json-note strong {
    display: block;
    margin-bottom: 5px;
    color: #1e3a8a;
    font-size: 0.88rem;
}

.analysis-json-note p {
    margin: 0;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.55;
}

/* =========================================================
   v3.5 — ORF5 amino acid comparison module
   ========================================================= */

.analysis-step-protein {
    background: #ffedd5;
    color: #c2410c;
}

.analysis-workflow-note-protein {
    border-color: #fed7aa;
    background: #fff7ed;
}

.analysis-protein-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.analysis-protein-output {
    margin-top: 24px;
}

.analysis-aa-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 14px;
}

.analysis-aa-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 750;
}

.analysis-aa-legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(15, 23, 42, 0.14);
}

.analysis-aa-same { background: #e2e8f0; }
.analysis-aa-different { background: #fee2e2; }
.analysis-aa-query-different { background: #fef3c7; }
.analysis-aa-gap { background: #f8fafc; }
.analysis-aa-ambiguous { background: #ede9fe; }
.analysis-aa-stop { background: #fecaca; }

.analysis-aa-viewer {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.analysis-aa-scroll {
    overflow-x: auto;
    padding: 12px 12px 16px;
}

.analysis-aa-ruler,
.analysis-aa-row {
    display: grid;
    grid-template-columns: 240px repeat(200, 22px);
    align-items: center;
    min-width: calc(240px + 200 * 22px);
}

.analysis-aa-ruler {
    margin-bottom: 7px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
}

.analysis-aa-ruler-label,
.analysis-aa-label {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 0;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
}

.analysis-aa-ruler-label {
    height: 22px;
}

.analysis-aa-position {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
}

.analysis-aa-row {
    border-top: 1px solid #f1f5f9;
}

.analysis-aa-row:first-child {
    border-top: 0;
}

.analysis-aa-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-height: 31px;
    padding: 5px 10px 5px 0;
    color: #0f172a;
    font-size: 0.74rem;
    font-weight: 850;
    line-height: 1.2;
}

.analysis-aa-label small {
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 700;
}

.analysis-aa-row-submitted .analysis-aa-label {
    color: #1d4ed8;
}

.analysis-aa-row-best .analysis-aa-label {
    color: #047857;
}

.analysis-aa-row-vaccine .analysis-aa-label {
    color: #7c2d12;
}

.analysis-aa-cell {
    display: grid;
    place-items: center;
    width: 22px;
    height: 31px;
    border-left: 1px solid #f8fafc;
    color: #0f172a;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.76rem;
    font-weight: 800;
}

.analysis-aa-cell-same {
    background: #f1f5f9;
    color: #334155;
}

.analysis-aa-cell-different {
    background: #fee2e2;
    color: #991b1b;
}

.analysis-aa-cell-query-different {
    background: #fef3c7;
    color: #92400e;
}

.analysis-aa-cell-gap {
    background: #ffffff;
    color: #cbd5e1;
}

.analysis-aa-cell-ambiguous {
    background: #ede9fe;
    color: #5b21b6;
}

.analysis-aa-cell-stop {
    background: #fecaca;
    color: #7f1d1d;
}

.analysis-vaccine-table-wrapper {
    margin-top: 18px;
}

.analysis-protein-step .analysis-result-alert {
    margin: 18px 0 0;
}

.analysis-workflow-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

@media (max-width: 1180px) {
    .analysis-protein-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .analysis-aa-ruler,
    .analysis-aa-row {
        grid-template-columns: 190px repeat(200, 21px);
        min-width: calc(190px + 200 * 21px);
    }

    .analysis-aa-cell,
    .analysis-aa-position {
        width: 21px;
    }
}


/* v3.5.4 — consent-based local storage status */
.analysis-storage-status {
    margin-top: 18px;
    padding: 15px 16px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
    color: #334155;
}

.analysis-storage-status.is-saved {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #14532d;
}

.analysis-storage-status.is-memory-only {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

.analysis-storage-status.is-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.analysis-storage-status strong {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.analysis-storage-status p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.55;
}


/* Publication notice for controlled sequence-analysis access */
.analysis-access-notice {
    width: min(760px, 100%);
    margin: 24px auto 0;
    padding: 13px 16px;
    border: 1px solid rgba(147, 197, 253, 0.55);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.52);
    color: #dbeafe;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(6px);
}

.analysis-access-notice strong {
    display: block;
    margin-bottom: 4px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.analysis-access-notice span {
    display: block;
    font-size: 0.92rem;
    line-height: 1.55;
}
