:root {
    --background: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #16202a;
    --text-muted: #647180;
    --border: #dce2e8;
    --primary: #182b49;
    --primary-hover: #0f2039;
    --accent: #2463eb;
    --error-background: #fff1f1;
    --error-border: #f1b6b6;
    --error-text: #9b1c1c;
    --shadow: 0 12px 30px rgba(20, 32, 45, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background: var(--background);
}

.site-header {
    padding: 38px 24px;
    color: white;
    background:
        linear-gradient(
            120deg,
            #11223d,
            #1a3b66
        );
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    width: min(1120px, 100%);
    margin: 0 auto;
}

.eyebrow,
.section-label {
    margin: 0 0 8px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow {
    color: #b9cef0;
}

.site-header h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
}

.header-description {
    max-width: 620px;
    margin: 14px 0 0;
    color: #d9e4f4;
}

.header-badge {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #dce9ff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.page-container {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto 64px;
}

.panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-panel {
    padding: clamp(24px, 4vw, 42px);
}

.section-heading,
.results-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.section-label {
    color: var(--accent);
}

h2,
h3 {
    margin-top: 0;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
}

h3 {
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.section-description {
    margin: 14px 0 28px;
    color: var(--text-muted);
}

.policy-chip {
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary);
    border: 1px solid #c7d4e6;
    border-radius: 999px;
    background: #edf3fb;
}

.alert {
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: 10px;
}

.alert-error {
    color: var(--error-text);
    border: 1px solid var(--error-border);
    background: var(--error-background);
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 750;
}

.field-help {
    margin: -3px 0 9px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

textarea {
    display: block;
    width: 100%;
    padding: 15px 16px;
    font: inherit;
    line-height: 1.55;
    color: var(--text);
    border: 1px solid #cbd4de;
    border-radius: 11px;
    outline: none;
    resize: vertical;
    background: #ffffff;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(36, 99, 235, 0.13);
}

.primary-button {
    padding: 13px 22px;
    font: inherit;
    font-weight: 800;
    color: white;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    background: var(--primary);
}

.primary-button:hover {
    background: var(--primary-hover);
}

.results-section {
    margin-top: 34px;
}

.results-heading {
    align-items: center;
    margin-bottom: 20px;
}

.confidence-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.confidence-display span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.confidence-display strong {
    font-size: 1.65rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.metric-card {
    min-height: 125px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
}

.metric-label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    line-height: 1.35;
}

.status-value {
    text-transform: capitalize;
}

.risk-low {
    color: #167247;
}

.risk-medium {
    color: #a15c00;
}

.risk-high {
    color: #b12e2e;
}

.risk-critical {
    color: #7b1628;
}

.result-card {
    margin-bottom: 16px;
    padding: 26px;
}

.result-card p {
    line-height: 1.65;
}

.two-column-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 16px;
}

.policy-reference {
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
}

.policy-reference + .policy-reference {
    margin-top: 12px;
}

.policy-reference-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.policy-reference-heading span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.policy-name {
    margin: 6px 0;
    font-weight: 700;
}

.policy-reference p:last-child {
    margin-bottom: 0;
}

ul,
ol {
    padding-left: 22px;
}

li {
    margin-bottom: 10px;
    line-height: 1.55;
}

.procedure-list li::marker {
    font-weight: 800;
    color: var(--accent);
}

.empty-state {
    color: var(--text-muted);
}

.notice {
    padding: 17px 19px;
    line-height: 1.55;
    color: #435365;
    border: 1px solid #cad9ec;
    border-radius: 12px;
    background: #edf4fc;
}

@media (max-width: 760px) {
    .header-content,
    .section-heading,
    .results-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-badge {
        align-self: flex-start;
    }

    .metrics-grid,
    .two-column-grid {
        grid-template-columns: 1fr;
    }

    .confidence-display {
        align-items: flex-start;
    }
}

.decision-reference {
    margin: 9px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.decision-reference strong {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Consolas,
        monospace;
}

.retrieved-policies {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.explainability-card {
    margin-top: 16px;
}

.explainability-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.explainability-description {
    margin-top: -4px;
    margin-bottom: 22px;
    color: var(--text-muted);
}

.explainability-badge {
    flex-shrink: 0;
    padding: 7px 11px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #244569;
    border: 1px solid #c7d7e9;
    border-radius: 999px;
    background: #eef4fb;
}

.retrieval-list {
    display: grid;
    gap: 14px;
}

.retrieval-policy {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-muted);
}

.retrieval-policy-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.retrieval-title {
    margin-left: 8px;
    color: var(--text-muted);
}

.retrieval-score {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.matched-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.term-chip {
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 5px 9px;
    border: 1px solid #c9d8e8;
    border-radius: 999px;
    background: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
}

.sections-used {
    margin-top: 18px;
}

.sections-label {
    margin-bottom: 9px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.retrieved-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 11px 0;
    border-top: 1px solid var(--border);
}

.retrieved-section span {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

@media (max-width: 760px) {
    .explainability-header,
    .retrieval-policy-heading,
    .retrieved-section {
        flex-direction: column;
        align-items: flex-start;
    }
}

.readiness-section {
    margin-bottom: 28px;
}

.readiness-card {
    padding: 28px;
    margin-bottom: 16px;
}

.readiness-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.readiness-main h2 {
    margin-bottom: 12px;
    font-size: 2.4rem;
}

.readiness-score {
    display: grid;
    place-items: center;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    font-size: 2.2rem;
    font-weight: 850;
    border: 10px solid #dce6f3;
    border-radius: 50%;
    background: #f8fbff;
}

.readiness-status {
    display: inline-block;
    padding: 7px 11px;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 999px;
}

.readiness-strong {
    color: #146c43;
    background: #e9f8f0;
}

.readiness-review {
    color: #295f9c;
    background: #ebf3fd;
}

.readiness-needs-work {
    color: #946000;
    background: #fff4d9;
}

.readiness-not-ready {
    color: #9d2828;
    background: #fdecec;
}

.readiness-breakdown {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 26px;
}

.readiness-metric {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-muted);
}

.readiness-metric span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.76rem;
    font-weight: 750;
    color: var(--text-muted);
}

.readiness-metric strong {
    font-size: 1.35rem;
}

.quality-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 760px) {
    .readiness-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .readiness-breakdown {
        grid-template-columns: 1fr 1fr;
    }

    .quality-detail-grid {
        grid-template-columns: 1fr;
    }
}

.evidence-document {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
}

.evidence-document-heading {
    margin-bottom: 14px;
}

.evidence-document-heading p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

.evidence-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    margin-bottom: 12px;
    padding: 17px;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: white;
}

.evidence-check input {
    width: 18px;
    height: 18px;
}

.source-excerpt {
    margin: 8px 0 10px;
    line-height: 1.5;
    color: var(--text-muted);
}

.confidence-chip {
    display: inline-block;
    padding: 5px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #36516d;
    border-radius: 999px;
    background: #edf3f9;
}
.case-link {
    display: inline-block;
    margin-bottom: 24px;
    text-decoration: none;
}
.confidence-help {
    margin-top: 3px;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.score-reasons {
    list-style: none;
    padding-left: 0;
}

.score-reasons li {
    padding-left: 26px;
    position: relative;
}

.positive-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: 800;
    color: #167247;
}

.warning-item::before {
    content: "!";
    position: absolute;
    left: 4px;
    font-weight: 900;
    color: #a15c00;
}
.readiness-definition {
    max-width: 640px;
    margin: 8px 0 16px;
    color: var(--text-muted);
    line-height: 1.5;
}
.advanced-retrieval {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.advanced-retrieval summary {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 750;
    color: var(--accent);
}

.advanced-retrieval summary:hover {
    text-decoration: underline;
}

.advanced-retrieval-body {
    margin-top: 12px;
    padding: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-radius: 10px;
    background: #ffffff;
}

.advanced-retrieval-body p {
    margin-top: 0;
}
input[type="file"] {
    width: 100%;
    padding: 16px;
    font: inherit;
    color: var(--text);
    border: 1px dashed #b9c7d6;
    border-radius: 12px;
    background: var(--surface-muted);
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 9px 13px;
    font: inherit;
    font-weight: 700;
    color: white;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    background: var(--primary);
}

.evidence-item:hover {
    border-color: #b8c9dc;
    box-shadow: 0 5px 15px rgba(20, 32, 45, 0.05);
}

/* =========================================================
   PUBLIC DEMO
   ========================================================= */

.demo-notice {
    margin-bottom: 22px;
    padding: 18px 20px;
    border: 1px solid #c7d7e9;
    border-radius: 14px;
    background: #eef4fb;
}

.demo-notice strong {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
}

.demo-notice p {
    margin: 0;
    line-height: 1.55;
    color: #435365;
}


/* =========================================================
   SAMPLE SCENARIOS
   ========================================================= */

.scenario-picker {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
}

.scenario-picker-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.scenario-label {
    margin: 0 0 4px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--primary);
    text-transform: uppercase;
}

.scenario-help {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.sample-badge {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #36516d;
    border: 1px solid #c7d7e9;
    border-radius: 999px;
    background: white;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.scenario-button {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 3px;
    width: 100%;
    padding: 16px;
    text-align: left;
    font: inherit;
    color: var(--text);
    cursor: pointer;
    border: 1px solid #cbd6e2;
    border-radius: 12px;
    background: white;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.scenario-button:hover {
    border-color: #9db6d3;
    box-shadow: 0 6px 16px rgba(20, 32, 45, 0.07);
    transform: translateY(-1px);
}

.scenario-button:focus-visible {
    outline: 3px solid rgba(36, 99, 235, 0.18);
    outline-offset: 2px;
}

.scenario-button.scenario-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(36, 99, 235, 0.10);
}

.scenario-number {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 0.72rem;
    font-weight: 850;
    color: var(--accent);
    border-radius: 9px;
    background: #edf3ff;
}

.scenario-button strong {
    font-size: 0.92rem;
}

.scenario-button small {
    line-height: 1.4;
    color: var(--text-muted);
}


/* =========================================================
   MOBILE DEMO
   ========================================================= */

@media (max-width: 760px) {
    .scenario-picker-heading {
        flex-direction: column;
    }

    .scenario-grid {
        grid-template-columns: 1fr;
    }
}



/* =========================================================
   GOVERNANCE REVIEW
   ========================================================= */

.governance-review-section {
    margin-top: 36px;
    margin-bottom: 40px;
}


/* =========================================================
   GOVERNANCE SUMMARY
   ========================================================= */

.governance-summary-card {
    margin-bottom: 38px;
    padding: 30px;
}

.governance-summary-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}

.governance-summary-header h2 {
    margin: 8px 0 10px;
}

.governance-summary-header .section-description {
    margin: 0;
    line-height: 1.6;
}

.governance-readiness-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;

    padding: 10px 16px;

    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    border-radius: 999px;
    white-space: nowrap;
}

.governance-blocked {
    color: #991b1b;
    background: #fee2e2;
}

.governance-ready {
    color: #166534;
    background: #dcfce7;
}


/* =========================================================
   BLOCKING ISSUES
   ========================================================= */

.governance-blockers {
    margin-top: 28px;
    padding: 24px 28px;

    border: 1px solid #fecaca;
    border-radius: 14px;

    background: #fff7f7;
}

.governance-blockers > strong {
    display: block;

    margin-bottom: 10px;

    font-size: 1rem;
    color: #991b1b;
}

.governance-blockers p {
    margin: 0 0 18px;

    line-height: 1.6;
    color: var(--text);
}

.governance-blockers ul {
    margin: 0;
    padding-left: 24px;
}

.governance-blockers li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.governance-blockers li:last-child {
    margin-bottom: 0;
}


/* =========================================================
   CLEAR / NON-BLOCKED STATE
   ========================================================= */

.governance-clear {
    margin-top: 28px;
    padding: 22px 24px;

    border: 1px solid #bbf7d0;
    border-radius: 14px;

    background: #f0fdf4;
}

.governance-clear strong {
    display: block;
    margin-bottom: 8px;

    color: #166534;
}

.governance-clear p {
    margin: 0;
    line-height: 1.6;
}


/* =========================================================
   COMPLIANCE MATRIX HEADING
   ========================================================= */

.compliance-heading {
    margin: 0 0 24px;
}

.compliance-heading h2 {
    margin: 8px 0 10px;
}

.compliance-heading .section-description {
    margin: 0;

    line-height: 1.6;
}


/* =========================================================
   COMPLIANCE MATRIX
   ========================================================= */

.compliance-matrix {
    display: grid;
    gap: 22px;
}


/* =========================================================
   COMPLIANCE CARD
   ========================================================= */

.compliance-card {
    padding: 26px 28px;

    border-left: 5px solid #cbd5e1;
}

.compliance-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 24px;
}


/* Status and obligation pills */

.compliance-status,
.obligation-chip {
    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;

    border-radius: 999px;
}

.obligation-chip {
    color: #475569;
    background: #f1f5f9;
}


/* Requirement text */

.compliance-card h3 {
    margin: 0 0 26px;

    font-size: 1.05rem;
    line-height: 1.55;
}


/* =========================================================
   COMPLIANCE STATUSES
   ========================================================= */

.compliance-satisfied {
    border-left-color: #16a34a;
}

.compliance-satisfied .compliance-status {
    color: #166534;
    background: #dcfce7;
}


.compliance-conflict {
    border-left-color: #dc2626;
}

.compliance-conflict .compliance-status {
    color: #991b1b;
    background: #fee2e2;
}


.compliance-missing {
    border-left-color: #ea580c;
}

.compliance-missing .compliance-status {
    color: #9a3412;
    background: #ffedd5;
}


.compliance-not-applicable {
    border-left-color: #94a3b8;
}

.compliance-not-applicable .compliance-status {
    color: #475569;
    background: #f1f5f9;
}


.compliance-requires-human-review {
    border-left-color: #d97706;
}

.compliance-requires-human-review .compliance-status {
    color: #92400e;
    background: #fef3c7;
}


/* =========================================================
   FINDING
   ========================================================= */

.compliance-finding {
    margin: 0 0 24px;
}

.compliance-finding > span {
    display: block;

    margin-bottom: 10px;

    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;

    color: var(--text-muted);

    text-transform: uppercase;
}

.compliance-finding p {
    margin: 0;

    line-height: 1.65;
}


/* =========================================================
   SUPPORTING EVIDENCE
   ========================================================= */

.compliance-evidence {
    margin-top: 24px;
    padding-top: 18px;

    border-top: 1px solid var(--border);
}

.compliance-evidence summary {
    padding: 3px 0;

    cursor: pointer;

    font-weight: 750;
    line-height: 1.5;

    color: var(--text);
}

.compliance-evidence summary:hover {
    color: var(--accent);
}

.compliance-evidence-list {
    display: grid;

    gap: 10px;

    margin-top: 16px;
}

.compliance-evidence-item {
    padding: 14px 16px;

    line-height: 1.6;

    color: #334155;

    border: 1px solid #e7ebf0;
    border-radius: 10px;

    background: var(--surface-muted);
}


/* =========================================================
   NO SUPPORTING EVIDENCE
   ========================================================= */

.compliance-no-evidence {
    margin: 24px 0 0;
    padding: 14px 16px;

    font-size: 0.84rem;
    line-height: 1.5;

    color: var(--text-muted);

    border-radius: 10px;

    background: var(--surface-muted);
}


/* =========================================================
   GOVERNANCE MOBILE
   ========================================================= */

@media (max-width: 760px) {

    .governance-summary-card {
        padding: 24px;
    }

    .governance-summary-header {
        flex-direction: column;
        gap: 18px;
    }

    .governance-readiness-badge {
        align-self: flex-start;
    }

    .governance-blockers {
        padding: 20px;
    }

    .compliance-card {
        padding: 22px 20px;
    }

    .compliance-card-header {
        flex-direction: column;
        align-items: flex-start;

        gap: 10px;

        margin-bottom: 20px;
    }

    .compliance-card h3 {
        margin-bottom: 22px;
    }
}

/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.new-case-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 16px;

    border-radius: 10px;

    background: #ffffff;
    color: #111827;

    font-size: 0.9rem;
    font-weight: 700;

    text-decoration: none;

    border: 1px solid rgba(255, 255, 255, 0.35);

    transition:
        transform 0.15s ease,
        background 0.15s ease;
}

.new-case-button:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

@media (max-width: 700px) {
    .header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 12px;
    }

    .new-case-button {
        min-height: 44px;
    }
}