
.code-tool-page {
    min-height: 100vh;
    color: var(--text, #243244);
    background: var(--body-bg, #f8fafc);
}

.code-tool-header {
    border-bottom: 1px solid var(--line, rgba(18, 59, 102, 0.12));
    background: var(--panel-solid, #ffffff);
}

.code-tool-header-inner,
.code-tool-main {
    width: min(1480px, calc(100vw - 32px));
    margin: 0 auto;
}

.code-tool-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
}

.code-tool-brand,
.code-tool-nav a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 900;
    text-decoration: none;
}

.code-tool-brand {
    color: var(--ink, #162334);
}

.code-tool-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.code-tool-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.code-tool-nav a {
    border: 1px solid var(--line, #cbd5e1);
    border-radius: 8px;
    color: #0f766e;
    background: #ecfeff;
    padding: 9px 11px;
    font-size: 13px;
}

.code-tool-main {
    padding: 28px 0 48px;
}

.code-tool-title {
    margin-bottom: 18px;
}

.code-tool-title .eyebrow {
    margin: 0 0 7px;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.code-tool-title h1 {
    margin: 0;
    color: var(--ink, #162334);
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: 0;
}

.code-tool-title .tagline {
    display: block;
    margin-top: 8px;
    color: var(--muted, #64748b);
    max-width: 820px;
    font-size: 15px;
    line-height: 1.55;
}

.code-tool-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 15px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.code-tool-highlights span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.code-tool-highlights i {
    color: #0f766e;
    font-size: 15px;
}

.code-tool-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 15px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.code-tool-highlights span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.code-tool-highlights i {
    color: #0f766e;
    font-size: 15px;
}

.code-tool-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 15px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.code-tool-highlights span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.code-tool-highlights i {
    color: #0f766e;
    font-size: 15px;
}

.code-workbench {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(220px, 1fr);
    gap: 16px;
    align-items: start;
}

.code-panel {
    border: 1px solid var(--line, #dbe4ea);
    border-radius: 8px;
    background: var(--panel-solid, #ffffff);
    box-shadow: var(--shadow-soft, 0 12px 34px rgba(18, 59, 102, 0.09));
    padding: 16px;
}

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

.code-panel-heading {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 170px;
}

.code-panel-heading strong {
    color: var(--ink, #162334);
    font-size: 15px;
}

.code-panel-heading span {
    color: var(--muted, #64748b);
    font-size: 12px;
}

.code-panel-heading {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 170px;
}

.code-panel-heading strong {
    color: var(--ink, #162334);
    font-size: 15px;
}

.code-panel-heading span {
    color: var(--muted, #64748b);
    font-size: 12px;
}

.code-panel-heading {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 170px;
}

.code-panel-heading strong {
    color: var(--ink, #162334);
    font-size: 15px;
}

.code-panel-heading span {
    color: var(--muted, #64748b);
    font-size: 12px;
}

.code-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.code-controls select,
.code-controls input,
.code-sample-select {
    border: 1px solid var(--line, #cbd5e1);
    border-radius: 8px;
    color: var(--text, #243244);
    background: var(--input-bg, #ffffff);
    padding: 9px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}

.code-editor-wrap {
    display: grid;
    grid-template-columns: 52px 1fr;
    min-height: 520px;
    border: 1px solid var(--line, #cbd5e1);
    border-radius: 8px;
    overflow: hidden;
    background: #eef2f5;
}

.code-lines {
    margin: 0;
    padding: 12px 10px;
    color: #64748b;
    background: #e2e8ee;
    text-align: right;
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    user-select: none;
    overflow: hidden;
}

.code-editor {
    width: 100%;
    min-height: 520px;
    resize: vertical;
    border: 0;
    outline: 0;
    color: #243244;
    background: #eef2f5;
    padding: 12px;
    font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    tab-size: var(--code-tab-size, 4);
    white-space: pre;
}

.code-editor.wrap {
    white-space: pre-wrap;
}

.code-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.code-actions button,
.code-cta a,
.code-tabs button {
    border: 0;
    border-radius: 8px;
    padding: 10px 13px;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
}

.code-actions .primary,
.code-cta .primary {
    color: #ffffff;
    background: #0f766e;
}

.code-actions .secondary,
.code-tabs button {
    color: #0f766e;
    border: 1px solid var(--line, #cbd5e1);
    background: #ecfeff;
}

.code-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.code-tabs button.active {
    color: #ffffff;
    background: #0f766e;
}

.code-message {
    margin-top: 10px;
    min-height: 20px;
    color: #0f766e;
    font-size: 13px;
    font-weight: 800;
}

.code-result {
    min-width: 0;
    display: grid;
    gap: 12px;
    align-self: start;
}

.result-card,
.code-cta,
.mindx-discovery-card {
    border: 1px solid var(--line, #dbe4ea);
    border-radius: 8px;
    background: var(--panel-solid, #ffffff);
    padding: 14px;
}

.result-card h2,
.result-card h3,
.code-cta h2,
.mindx-discovery-card h3 {
    margin: 0 0 8px;
    color: var(--ink, #162334);
    font-size: 15px;
}

.result-card p,
.code-cta p,
.mindx-discovery-card p {
    margin: 0;
    color: var(--muted, #64748b);
    font-size: 13px;
    line-height: 1.55;
}

.result-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text, #243244);
    font-size: 13px;
    line-height: 1.55;
}

.score-card strong {
    display: block;
    color: var(--ink, #162334);
    font-size: 38px;
    line-height: 1;
}

.score-meter {
    height: 10px;
    margin-top: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.score-meter span {
    display: block;
    height: 100%;
    width: var(--score-width, 0%);
    background: linear-gradient(90deg, #0f766e, #f59e0b, #ef4444);
}

.finding {
    border-top: 1px solid var(--line, #dbe4ea);
    padding-top: 10px;
    margin-top: 10px;
}

.finding b {
    color: var(--ink, #162334);
}

.code-cta {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.mindx-discovery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.mindx-discovery-card a {
    display: inline-flex;
    margin-top: 8px;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

@media (min-width: 1400px) {
    .code-tool-main {
        padding-top: 36px;
    }

    .code-panel {
        padding: 20px;
    }

    .code-editor-wrap,
    .code-editor {
        min-height: 580px;
    }
}

@media (min-width: 1400px) {
    .code-tool-main {
        padding-top: 36px;
    }

    .code-panel {
        padding: 20px;
    }

    .code-editor-wrap,
    .code-editor {
        min-height: 580px;
    }
}

@media (min-width: 1400px) {
    .code-tool-main {
        padding-top: 36px;
    }

    .code-panel {
        padding: 20px;
    }

    .code-editor-wrap,
    .code-editor {
        min-height: 660px;
    }
}

@media (max-width: 900px) {
    .code-workbench {
        grid-template-columns: 1fr;
    }

    .code-editor-wrap,
    .code-editor {
        min-height: 430px;
    }

    .code-editor-wrap,
    .code-editor {
        min-height: 430px;
    }

    .code-editor-wrap,
    .code-editor {
        min-height: 430px;
    }

    .code-toolbar,
    .code-panel-heading,
    .code-cta,
    .code-tool-header-inner {
        align-items: stretch;
        flex-direction: column;
    }
}


.code-sample-select {
    min-width: 174px;
    color: #0f766e !important;
    background: #f0fdfa !important;
    border-color: #99d5ce !important;
}

.code-sample-select:focus {
    outline: 3px solid rgba(15, 118, 110, 0.16);
    outline-offset: 1px;
}


.findings-card {
    min-height: 0;
}

.findings-list {
    max-height: min(560px, 60vh);
    overflow-y: auto;
    padding-right: 5px;
}

.healthy-result {
    color: #166534 !important;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px;
}


.findings-list {
    max-height: min(560px, calc(100vh - 280px));
    min-height: 160px;
    overflow-y: auto;
    padding-right: 7px;
}

.finding-group + .finding-group {
    margin-top: 16px;
}

.finding-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.finding-group-title span {
    font-size: 11px;
}

.severity-critical { color: #991b1b; background: #fef2f2; }
.severity-high { color: #9a3412; background: #fff7ed; }
.severity-medium { color: #854d0e; background: #fefce8; }
.severity-low { color: #166534; background: #f0fdf4; }

@media (max-width: 900px) {
    .findings-list {
        max-height: 55vh;
    }
}


.score-formula {
    margin-top: 5px !important;
    color: #64748b !important;
    font-size: 11px !important;
    font-weight: 700;
}

.finding-points {
    float: right;
    color: #b45309;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}


.developer-tool-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.developer-tool-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 11px;
    border: 1px solid var(--line, #cbd5e1);
    border-radius: 8px;
    color: #0f766e;
    background: #f0fdfa;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.developer-tool-nav a.active,
.developer-tool-nav a:hover {
    color: #ffffff;
    background: #0f766e;
    border-color: #0f766e;
}

@media (max-width: 700px) {
    .developer-tool-nav {
        justify-content: flex-start;
    }
}


.analysis-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.analysis-facts span {
    padding: 6px 8px;
    border: 1px solid #dbe4ea;
    border-radius: 6px;
    color: #64748b;
    background: #f8fafc;
    font-size: 11px;
}

.analysis-facts b {
    color: #334155;
}


.plan-guide {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    color: #164e63;
    background: #f0f9ff;
    font-size: 12px;
    line-height: 1.55;
}

.plan-guide strong { color: #0e7490; }
.plan-guide code { display: block; margin-top: 8px; white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }


.finding-inspect {
    display: block;
    margin-top: 8px;
    padding: 4px 7px;
    border: 1px solid #99d5ce;
    border-radius: 6px;
    color: #0f766e;
    background: #f0fdfa;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.finding-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .48);
}

.finding-popup {
    position: relative;
    width: min(620px, 100%);
    max-height: min(720px, 90vh);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.finding-popup h2 { margin: 0 35px 8px 0; color: #162334; font-size: 19px; }
.finding-popup p { color: #475569; font-size: 13px; line-height: 1.6; }
.finding-popup-meta { color: #0f766e !important; font-weight: 800; }
.finding-popup pre { margin: 14px 0; padding: 12px; overflow-x: auto; border-radius: 6px; color: #243244; background: #eef2f5; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; }
.finding-popup-close { position: absolute; top: 12px; right: 12px; border: 0; color: #475569; background: transparent; font-size: 25px; cursor: pointer; }
.finding-fix-note { display: block; margin-top: 9px; color: #64748b; font-size: 11px; }


.code-editor.fix-applied {
    outline: 3px solid rgba(22, 101, 52, .35);
    outline-offset: -3px;
}


.fix-impact {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    background: #f0fdf4;
    font-size: 12px;
}

.fix-impact span { font-weight: 800; }
.fix-impact em { flex-basis: 100%; color: #4d7c5b; font-size: 11px; font-style: normal; }


.ai-insights-note { color: #0e7490 !important; font-weight: 800; }
.ai-insights-output { max-height: min(620px, calc(100vh - 300px)); overflow-y: auto; margin-top: 12px; padding: 14px; border: 1px solid #bae6fd; border-radius: 8px; color: #243244; background: #f8fafc; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.ai-usage { margin-top: 10px !important; color: #64748b !important; font-size: 11px !important; }


@media (max-width: 900px) {
    .ai-insights-output {
        max-height: 52vh;
    }
}


.ai-insights-output h2,
.ai-insights-output h3 { margin: 0 0 9px; color: #162334; line-height: 1.25; }
.ai-insights-output h2 { font-size: 18px; }
.ai-insights-output h3 { font-size: 15px; color: #0e7490; }
.ai-insights-output ul { margin: 5px 0 12px; padding-left: 20px; }
.ai-insights-output li { margin: 5px 0; }
.ai-insights-output strong { color: #162334; }


.code-actions select[data-code-language] {
    min-width: 150px;
    border: 1px solid var(--line, #cbd5e1);
    border-radius: 8px;
    color: #0f766e;
    background: #f0fdfa;
    padding: 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
}

.finding-learn-more { display: inline-block; margin: 4px 0 12px; font-size: .82rem; font-weight: 600; color: #0f7490; text-decoration: none; }
.finding-learn-more:hover { text-decoration: underline; }
