:root {
    --fpc-red: #b10f1a;
    --fpc-red-dark: #8e0c15;
    --fpc-navy: #102c54;
    --fpc-slate: #303a48;
    --fpc-muted: #667180;
    --fpc-bg: #f5f7fa;
    --fpc-card: #ffffff;
    --fpc-border: #dde2eb;
    --fpc-radius: 18px;
    --fpc-shadow: 0 10px 30px rgba(16, 44, 84, 0.10);
    --fpc-shadow-soft: 0 8px 20px rgba(16, 44, 84, 0.08);
    --fpc-width: 1160px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--fpc-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--fpc-slate);
    background: var(--fpc-bg);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

.container {
    width: min(calc(100% - 40px), var(--fpc-width));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--fpc-border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 16px rgba(16, 44, 84, 0.05);
}

.header-inner {
    min-height: 104px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--fpc-navy);
    text-decoration: none;
}

.brand img {
    display: block;
    width: auto;
    height: 80px;
}

.brand-divider {
    width: 1px;
    height: 52px;
    background: var(--fpc-border);
}

.brand-title {
    font-size: 1.08rem;
    font-weight: 750;
    line-height: 1.2;
}

.brand-title small {
    display: block;
    margin-top: 5px;
    color: var(--fpc-muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    padding: 11px 13px;
    border-radius: 10px;
    color: var(--fpc-navy);
    font-size: 0.93rem;
    font-weight: 700;
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--fpc-red);
    background: rgba(177, 15, 26, 0.07);
}

.main-nav a[aria-disabled="true"] {
    cursor: default;
}

.hero {
    color: white;
    background:
        linear-gradient(
            90deg,
            rgba(16, 44, 84, 0.98) 0%,
            rgba(16, 44, 84, 0.90) 54%,
            rgba(16, 44, 84, 0.50) 100%
        ),
        url("/static/img/hero-bg.jpg") center / cover no-repeat;
}

.hero-inner {
    min-height: 430px;
    display: flex;
    align-items: center;
    padding-block: 70px;
}

.hero-copy {
    width: min(760px, 100%);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.eyebrow.red {
    color: var(--fpc-red);
}

.hero h1 {
    max-width: 720px;
    margin: 0 0 16px;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.hero-copy > p {
    max-width: 690px;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.12rem;
}

.knowledge-search {
    display: flex;
    max-width: 760px;
    margin-top: 32px;
    padding: 8px;
    border-radius: 15px;
    background: white;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.knowledge-search input {
    min-width: 0;
    flex: 1;
    padding: 15px 17px;
    border: 0;
    outline: 0;
    color: var(--fpc-slate);
    background: transparent;
    font: inherit;
}

.knowledge-search button {
    padding: 14px 22px;
    border: 0;
    border-radius: 11px;
    color: white;
    background: var(--fpc-red);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.knowledge-search button:hover {
    background: var(--fpc-red-dark);
}

.hero .search-note {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.82rem;
}

.workspace-section {
    padding: 70px 0;
    background:
        linear-gradient(
            rgba(245, 247, 250, 0.94),
            rgba(245, 247, 250, 0.98)
        ),
        url("/static/img/section-bg.jpg") center top / cover no-repeat;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 32px;
}

.section-heading h2 {
    margin: 0 0 9px;
    color: var(--fpc-navy);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
}

.section-heading p {
    margin: 0;
    color: var(--fpc-muted);
}

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

.action-card {
    min-height: 275px;
    padding: 27px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: var(--fpc-card);
    box-shadow: var(--fpc-shadow-soft);
}

.card-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 23px;
    border-radius: 12px;
    color: var(--fpc-red);
    background: rgba(177, 15, 26, 0.08);
    font-size: 0.78rem;
    font-weight: 850;
}

.action-card h3 {
    margin: 0 0 10px;
    color: var(--fpc-navy);
    font-size: 1.2rem;
    line-height: 1.25;
}

.action-card p {
    margin: 0 0 22px;
    color: var(--fpc-muted);
    font-size: 0.93rem;
}

.action-card a {
    margin-top: auto;
    color: var(--fpc-red);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.status-panel {
    margin-top: 28px;
    padding: 19px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--fpc-border);
    border-radius: 14px;
    background: white;
    box-shadow: var(--fpc-shadow-soft);
}

.status-panel > div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fpc-navy);
}

.status-panel p {
    margin: 0;
    color: var(--fpc-muted);
    font-size: 0.88rem;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #2d9b5f;
    box-shadow: 0 0 0 5px rgba(45, 155, 95, 0.12);
}

.site-footer {
    padding: 25px 0;
    color: rgba(255, 255, 255, 0.74);
    background: var(--fpc-navy);
    font-size: 0.83rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 920px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 12px;
        gap: 8px;
    }

    .main-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 7px;
    }

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

@media (max-width: 600px) {
    .container {
        width: min(calc(100% - 28px), var(--fpc-width));
    }

    .brand img {
        height: 64px;
    }

    .brand-divider,
    .brand-title small {
        display: none;
    }

    .hero-inner {
        min-height: 390px;
        padding-block: 55px;
    }

    .knowledge-search {
        align-items: stretch;
        flex-direction: column;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .status-panel,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* === FPC DOCUMENT BROWSER === */

.page-banner {
    color: white;
    background:
        linear-gradient(
            90deg,
            rgba(16, 44, 84, 0.98),
            rgba(16, 44, 84, 0.76)
        ),
        url("/static/img/hero-bg.jpg") center / cover no-repeat;
}

.page-banner-inner {
    padding-block: 54px;
}

.page-banner h1 {
    margin: 0 0 8px;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    line-height: 1.08;
}

.page-banner p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.document-section {
    min-height: 480px;
    padding: 62px 0 76px;
}

.document-heading {
    margin-bottom: 26px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.document-heading h2 {
    margin: 0;
    color: var(--fpc-navy);
    font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.document-count {
    padding: 8px 13px;
    border-radius: 999px;
    color: var(--fpc-navy);
    background: white;
    box-shadow: var(--fpc-shadow-soft);
    font-size: 0.84rem;
    font-weight: 750;
}

.document-list {
    display: grid;
    gap: 14px;
}

.document-row {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--fpc-border);
    border-radius: 15px;
    background: white;
    box-shadow: var(--fpc-shadow-soft);
}

.document-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: white;
    background: var(--fpc-red);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.05em;
}

.document-details {
    min-width: 0;
    flex: 1;
}

.document-details h3 {
    margin: 0 0 4px;
    color: var(--fpc-navy);
    font-size: 1.08rem;
}

.document-details p {
    margin: 0;
    color: var(--fpc-muted);
    font-size: 0.87rem;
}

.document-details p span::before {
    content: "•";
    margin-inline: 8px;
}

.source-badge {
    padding: 7px 10px;
    border-radius: 9px;
    color: #237447;
    background: rgba(45, 155, 95, 0.10);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-dot.warning {
    background: #d79524;
    box-shadow: 0 0 0 5px rgba(215, 149, 36, 0.13);
}

.service-message {
    padding: 30px;
    border: 1px solid var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: white;
    box-shadow: var(--fpc-shadow-soft);
}

.service-message strong {
    color: var(--fpc-navy);
    font-size: 1.05rem;
}

.service-message p {
    margin: 6px 0 0;
    color: var(--fpc-muted);
}

.service-message.error {
    border-color: rgba(177, 15, 26, 0.25);
}

.service-message.error strong {
    color: var(--fpc-red);
}

.pagination {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    color: var(--fpc-muted);
    font-size: 0.88rem;
}

.pagination a {
    color: var(--fpc-red);
    font-weight: 800;
    text-decoration: none;
}

.pagination a:last-child {
    text-align: right;
}

@media (max-width: 600px) {
    .document-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .document-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .source-badge {
        margin-left: 70px;
    }
}

/* === FPC SPECIALISTS PAGE === */

.service-status-grid {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.service-status-grid .status-panel {
    margin-top: 0;
    align-items: flex-start;
    flex-direction: column;
}

.specialists-section {
    min-height: 520px;
    padding: 62px 0 76px;
}

.specialists-layout {
    display: grid;
    gap: 24px;
}

.specialist-form-card,
.specialist-result {
    padding: 30px;
    border: 1px solid var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: white;
    box-shadow: var(--fpc-shadow);
}

.specialist-form-card h2,
.specialist-result h2 {
    margin: 0 0 10px;
    color: var(--fpc-navy);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.specialist-form-card > p {
    max-width: 760px;
    margin: 0;
    color: var(--fpc-muted);
}

.specialist-form {
    margin-top: 26px;
}

.specialist-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--fpc-navy);
    font-size: 0.88rem;
    font-weight: 800;
}

.specialist-input-row {
    display: flex;
    gap: 10px;
}

.specialist-input-row input {
    min-width: 0;
    flex: 1;
    padding: 15px 16px;
    border: 1px solid var(--fpc-border);
    border-radius: 11px;
    outline: none;
    color: var(--fpc-slate);
    background: var(--fpc-bg);
    font: inherit;
}

.specialist-input-row input:focus {
    border-color: var(--fpc-navy);
    box-shadow: 0 0 0 4px rgba(16, 44, 84, 0.08);
}

.specialist-input-row button {
    padding: 14px 20px;
    border: 0;
    border-radius: 11px;
    color: white;
    background: var(--fpc-red);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.specialist-input-row button:hover {
    background: var(--fpc-red-dark);
}

.evidence-notice {
    margin-top: 18px;
    padding: 14px 16px;
    border-left: 4px solid #d79524;
    border-radius: 8px;
    color: #6c552a;
    background: rgba(215, 149, 36, 0.10);
    font-size: 0.86rem;
}

.result-label {
    display: inline-block;
    margin-bottom: 10px;
    color: #237447;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.specialist-result.uncertain .result-label,
.specialist-result.error .result-label {
    color: var(--fpc-red);
}

.specialist-result pre {
    margin: 22px 0 0;
    padding: 22px;
    overflow-x: auto;
    border-radius: 13px;
    color: var(--fpc-slate);
    background: var(--fpc-bg);
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.specialist-result.error p {
    margin: 0;
    color: var(--fpc-muted);
}

.result-timing {
    margin: 14px 0 0;
    color: var(--fpc-muted);
    font-size: 0.78rem;
}

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

    .specialist-input-row {
        flex-direction: column;
    }
}

/* === FPC SEARCH RESULTS PAGE === */

.search-results-section {
    min-height: 520px;
    padding: 52px 0 76px;
}

.results-search-form {
    display: flex;
    max-width: 860px;
    margin-bottom: 44px;
    padding: 7px;
    border: 1px solid var(--fpc-border);
    border-radius: 14px;
    background: white;
    box-shadow: var(--fpc-shadow-soft);
}

.results-search-form input {
    min-width: 0;
    flex: 1;
    padding: 14px 16px;
    border: 0;
    outline: none;
    color: var(--fpc-slate);
    background: transparent;
    font: inherit;
}

.results-search-form button {
    padding: 13px 20px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: var(--fpc-red);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.results-search-form button:hover {
    background: var(--fpc-red-dark);
}

.search-heading {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.search-heading h2 {
    margin: 0;
    color: var(--fpc-navy);
    font-size: clamp(1.6rem, 4vw, 2.35rem);
}

.search-message {
    margin-top: 10px;
}

@media (max-width: 600px) {
    .results-search-form {
        flex-direction: column;
    }

    .search-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* === FPC PROTECTED PAGE VIEWER === */

.document-title-link {
    color: var(--fpc-navy);
    text-decoration: none;
}

.document-title-link:hover {
    color: var(--fpc-red);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.document-view-section {
    min-height: 560px;
    padding: 42px 0 76px;
}

.back-link {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--fpc-red);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.document-view-heading {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.document-view-heading h2 {
    margin: 0;
    color: var(--fpc-navy);
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    line-height: 1.2;
}

.document-view-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 24px;
}

.document-viewer,
.document-summary {
    border: 1px solid var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: white;
    box-shadow: var(--fpc-shadow-soft);
}

.document-page-toolbar {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--fpc-border);
}

.page-button,
.page-jump-form button {
    padding: 9px 13px;
    border: 0;
    border-radius: 9px;
    color: white;
    background: var(--fpc-red);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.page-button:hover,
.page-jump-form button:hover {
    background: var(--fpc-red-dark);
}

.page-button.disabled {
    color: var(--fpc-muted);
    background: var(--fpc-bg);
    cursor: default;
}

.page-jump-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--fpc-navy);
    font-size: 0.84rem;
    font-weight: 700;
}

.page-jump-form input {
    width: 78px;
    padding: 8px;
    border: 1px solid var(--fpc-border);
    border-radius: 8px;
    color: var(--fpc-slate);
    background: white;
    font: inherit;
}

.document-page-frame {
    padding: 18px;
    overflow: auto;
    background: #e9edf3;
    border-radius: 0 0 var(--fpc-radius) var(--fpc-radius);
}

.document-page-frame img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #d3d8e0;
    background: white;
    box-shadow: 0 8px 24px rgba(16, 44, 84, 0.15);
}

.document-summary {
    padding: 24px;
}

.document-summary h3 {
    margin: 20px 0 16px;
    color: var(--fpc-navy);
    font-size: 1.18rem;
}

.document-summary dl {
    margin: 0;
}

.document-summary dl div {
    padding: 11px 0;
    border-bottom: 1px solid var(--fpc-border);
}

.document-summary dt {
    color: var(--fpc-muted);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.document-summary dd {
    margin: 3px 0 0;
    color: var(--fpc-slate);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.document-evidence-note {
    margin: 20px 0 0;
    color: var(--fpc-muted);
    font-size: 0.82rem;
}

.document-view-message {
    margin-top: 12px;
}

@media (max-width: 880px) {
    .document-view-layout {
        grid-template-columns: 1fr;
    }

    .document-summary {
        order: -1;
    }
}

@media (max-width: 680px) {
    .document-view-heading,
    .document-page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .page-jump-form {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .page-button {
        text-align: center;
    }

    .document-page-frame {
        padding: 9px;
    }
}

/* === FPC VISUAL PAGE ANALYSIS === */

.visual-analysis-panel {
    margin-top: 28px;
    padding: 28px;
    border: 1px solid var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: white;
    box-shadow: var(--fpc-shadow-soft);
}

.visual-analysis-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.visual-analysis-heading h2 {
    margin: 0 0 7px;
    color: var(--fpc-navy);
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.visual-analysis-heading p {
    max-width: 720px;
    margin: 0;
    color: var(--fpc-muted);
}

.analysis-mode-badge,
.confidence-badge {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--fpc-navy);
    background: rgba(16, 44, 84, 0.07);
    font-size: 0.78rem;
    font-weight: 800;
}

.visual-analysis-form {
    margin-top: 24px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.visual-analysis-field {
    max-width: 520px;
    flex: 1;
}

.visual-analysis-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--fpc-navy);
    font-size: 0.86rem;
    font-weight: 800;
}

.visual-analysis-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--fpc-border);
    border-radius: 10px;
    color: var(--fpc-slate);
    background: white;
    font: inherit;
}

.visual-analysis-form button {
    padding: 13px 20px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: var(--fpc-red);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.visual-analysis-form button:hover {
    background: var(--fpc-red-dark);
}

.visual-analysis-note {
    margin: 12px 0 0;
    color: var(--fpc-muted);
    font-size: 0.82rem;
}

.analysis-message {
    margin-top: 22px;
}

.visual-result {
    margin-top: 26px;
    padding-top: 24px;
    border-top: 1px solid var(--fpc-border);
}

.visual-result-summary {
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.visual-result-summary h3 {
    margin: 0;
    color: var(--fpc-navy);
    font-size: 1.25rem;
}

.visual-result-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--fpc-border);
    border-radius: 12px;
}

.visual-result-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.visual-result-table th,
.visual-result-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--fpc-border);
    text-align: left;
}

.visual-result-table th {
    color: var(--fpc-navy);
    background: var(--fpc-bg);
    font-size: 0.78rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.visual-result-table tbody tr:last-child td {
    border-bottom: 0;
}

.visual-result-table td strong {
    color: var(--fpc-navy);
}

.visual-result-time {
    margin: 12px 0 0;
    color: var(--fpc-muted);
    font-size: 0.82rem;
    text-align: right;
}

@media (max-width: 680px) {
    .visual-analysis-heading,
    .visual-result-summary,
    .visual-analysis-form {
        align-items: stretch;
        flex-direction: column;
    }

    .analysis-mode-badge,
    .confidence-badge {
        align-self: flex-start;
    }

    .visual-analysis-form button {
        width: 100%;
    }
}

/* CATALOGUE UPLOAD INTERFACE */

.catalogue-upload-section {
    padding: 4rem 0 5rem;
    background: #f4f7fb;
}

.catalogue-upload-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
    gap: 2rem;
    align-items: start;
}

.catalogue-upload-card,
.catalogue-upload-guide {
    background: #ffffff;
    border: 1px solid #dfe5ee;
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(15, 43, 83, 0.08);
}

.catalogue-upload-card {
    padding: 2rem;
}

.catalogue-upload-guide {
    padding: 1.75rem;
    position: sticky;
    top: 2rem;
}

.catalogue-upload-guide h2,
.catalogue-upload-guide h3 {
    color: #0d2d59;
}

.catalogue-upload-guide ol {
    padding-left: 1.25rem;
    color: #5d6878;
}

.catalogue-upload-guide li + li {
    margin-top: 0.65rem;
}

.catalogue-upload-form label {
    display: block;
    margin: 1rem 0 0.45rem;
    color: #0d2d59;
    font-weight: 700;
}

.catalogue-upload-form label span {
    color: #768294;
    font-size: 0.8rem;
    font-weight: 500;
}

.catalogue-upload-form input[type="text"],
.catalogue-upload-form input[type="url"],
.catalogue-upload-form input[type="file"],
.catalogue-upload-form select,
.catalogue-upload-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccd5e1;
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
    background: #ffffff;
    color: #172b49;
    font: inherit;
}

.catalogue-upload-form input:focus,
.catalogue-upload-form select:focus,
.catalogue-upload-form textarea:focus {
    outline: 3px solid rgba(190, 16, 31, 0.12);
    border-color: #bd101f;
}

.catalogue-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
}

.form-section-heading {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin: 2.2rem 0 1rem;
    padding-top: 1.8rem;
    border-top: 1px solid #e3e8ef;
}

.form-section-heading:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.form-section-heading > span {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fbecee;
    color: #b20e1d;
    font-weight: 800;
}

.form-section-heading h2 {
    margin: 0;
    color: #0d2d59;
}

.form-section-heading p,
.field-help {
    margin: 0.35rem 0 0;
    color: #758092;
}

.catalogue-confirmation {
    display: flex !important;
    gap: 0.75rem;
    align-items: flex-start;
    margin-top: 1.5rem !important;
    padding: 1rem;
    border-radius: 10px;
    background: #f4f7fb;
}

.catalogue-confirmation input {
    margin-top: 0.2rem;
}

.catalogue-safety-note {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-left: 4px solid #bd101f;
    background: #fff7f8;
    color: #526071;
}

.catalogue-safety-note strong {
    color: #9f0d19;
}

.catalogue-safety-note p {
    margin: 0.35rem 0 0;
}

.catalogue-upload-button,
.catalogue-primary-link,
.catalogue-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    padding: 0.85rem 1.25rem;
    font-weight: 800;
    text-decoration: none;
}

.catalogue-upload-button,
.catalogue-primary-link {
    border: 0;
    background: #b90f1e;
    color: #ffffff;
}

.catalogue-upload-button {
    margin-top: 1.5rem;
    cursor: pointer;
}

.catalogue-secondary-link {
    border: 1px solid #ccd5e1;
    color: #0d2d59;
    background: #ffffff;
}

.catalogue-message {
    border-radius: 12px;
    padding: 1.25rem;
}

.catalogue-message.error {
    margin-bottom: 1.25rem;
    background: #fff0f1;
    border: 1px solid #edc5ca;
    color: #8f101c;
}

.catalogue-message.success {
    background: #f1fbf6;
    border: 1px solid #bfe5cf;
    color: #244c37;
}

.catalogue-message p {
    margin-bottom: 0;
}

.catalogue-result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.catalogue-result-details div {
    padding: 1rem;
    border-radius: 10px;
    background: #ffffff;
}

.catalogue-result-details dt {
    color: #748092;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.catalogue-result-details dd {
    margin: 0.3rem 0 0;
    color: #0d2d59;
    font-weight: 700;
}

.catalogue-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cabinet-tree {
    display: grid;
    gap: 0.45rem;
    margin: 1.25rem 0;
    padding: 1rem;
    border-radius: 10px;
    background: #f4f7fb;
    color: #0d2d59;
}

.cabinet-tree span {
    margin-left: 1rem;
}

.cabinet-tree em {
    margin-left: 2rem;
    color: #b20e1d;
    font-style: normal;
    font-weight: 700;
}

@media (max-width: 850px) {
    .catalogue-upload-layout,
    .catalogue-form-grid {
        grid-template-columns: 1fr;
    }

    .catalogue-upload-guide {
        position: static;
    }

    .catalogue-result-details {
        grid-template-columns: 1fr;
    }
}

/* CATALOGUE CLASSIFICATION V0.8 */

.cabinet-tree + .cabinet-tree {
    margin-top: 0.75rem;
}

.cabinet-tree small {
    margin-left: 3rem;
    color: #68768a;
    font-size: 0.85rem;
    font-weight: 600;
}

/* === FPC SPECIALIST SOURCE LINKS === */

.specialist-sources {
    margin-top: 26px;
    padding-top: 26px;
    border-top: 1px solid var(--fpc-border);
}

.specialist-sources-heading h3 {
    margin: 6px 0 6px;
    color: var(--fpc-navy);
    font-size: 1.25rem;
}

.specialist-sources-heading p {
    margin: 0;
    color: var(--fpc-muted);
    font-size: 0.9rem;
}

.specialist-source-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(245px, 1fr)
    );
    gap: 14px;
    margin-top: 18px;
}

.specialist-source-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 18px;
    border: 1px solid var(--fpc-border);
    border-radius: 12px;
    background: var(--fpc-bg);
}

.source-match {
    color: var(--fpc-muted);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.source-match-exact,
.source-match-prefix {
    color: #237447;
}

.source-code {
    color: var(--fpc-navy);
    font-size: 1.04rem;
    overflow-wrap: anywhere;
}

.source-document,
.source-page {
    color: var(--fpc-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.source-page-link {
    display: inline-flex;
    margin-top: 6px;
    padding: 10px 13px;
    border-radius: 9px;
    color: white;
    background: var(--fpc-red);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

.source-page-link:hover {
    color: white;
    background: var(--fpc-red-dark);
}

/* === FPC PROTECTED PAGE ZOOM VIEWER === */

.document-zoom-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--fpc-border);
    background: #f7f9fc;
}

.document-zoom-toolbar button {
    min-width: 42px;
    padding: 9px 12px;
    border: 1px solid var(--fpc-border);
    border-radius: 8px;
    color: var(--fpc-navy);
    background: white;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.document-zoom-toolbar button:hover {
    border-color: var(--fpc-navy);
    background: #eef2f7;
}

.document-zoom-value {
    min-width: 56px;
    color: var(--fpc-navy);
    font-size: 0.82rem;
    font-weight: 850;
    text-align: center;
}

.document-view-target {
    margin-left: auto;
    padding: 8px 11px;
    border-radius: 8px;
    color: #6c552a;
    background: rgba(215, 149, 36, 0.12);
    font-size: 0.78rem;
}

.document-page-frame {
    position: relative;
    max-height: 78vh;
    overscroll-behavior: contain;
    touch-action: none;
}

.document-page-frame.is-zoomed {
    cursor: grab;
}

.document-page-frame.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.document-page-frame img {
    transform-origin: top left;
    user-select: none;
    -webkit-user-drag: none;
}

.document-page-frame:fullscreen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    padding: 18px;
    overflow: auto;
    border-radius: 0;
    background: #202734;
}

.document-page-frame:fullscreen img {
    margin: 0 auto;
}

@media (max-width: 680px) {
    .document-view-target {
        width: 100%;
        margin-left: 0;
    }

    .document-zoom-toolbar button {
        flex: 1;
    }
}

/* === FPC CATALOGUE PRINT AND PDF CONTROLS === */

.document-zoom-toolbar button[data-zoom-action="pdf"] {
    color: white;
    border-color: var(--fpc-red);
    background: var(--fpc-red);
}

.document-zoom-toolbar button[data-zoom-action="pdf"]:hover {
    color: white;
    border-color: var(--fpc-red-dark);
    background: var(--fpc-red-dark);
}

.document-zoom-toolbar button:disabled {
    opacity: 0.7;
    cursor: progress;
}

/* === FPC SINGLE BABY SEARCH === */

.baby-query-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 26px;
}

.baby-query-heading h2 {
    margin: 4px 0 0;
    color: var(--fpc-navy);
    font-size: clamp(1.4rem, 4vw, 2rem);
}

.new-baby-question {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 10px;
    color: white;
    background: var(--fpc-red);
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
}

.new-baby-question:hover {
    background: var(--fpc-red-dark);
}

.baby-answer-card {
    margin-bottom: 38px;
    padding: 30px;
    border: 1px solid var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: white;
    box-shadow: var(--fpc-shadow);
}

.baby-answer-card h2 {
    margin: 0 0 10px;
    color: var(--fpc-navy);
}

.baby-answer-card pre {
    margin: 20px 0 0;
    padding: 22px;
    overflow-x: auto;
    border-radius: 13px;
    color: var(--fpc-slate);
    background: var(--fpc-bg);
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.product-description {
    margin: 8px 0 10px;
    color: var(--fpc-slate);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.45;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 3px 0 12px;
}

.product-meta span {
    padding: 5px 9px;
    border-radius: 8px;
    color: var(--fpc-navy);
    background: var(--fpc-bg);
    font-size: 0.76rem;
    font-weight: 800;
}

.product-reasons {
    margin: 11px 0;
    padding-left: 19px;
    color: var(--fpc-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.product-warning {
    width: 100%;
    margin: 7px 0;
    padding: 9px 11px;
    border-left: 3px solid #d79524;
    border-radius: 6px;
    color: #6c552a;
    background: rgba(215, 149, 36, 0.10);
    font-size: 0.79rem;
}

.baby-document-results {
    margin-top: 30px;
}

@media (max-width: 760px) {
    .baby-query-heading {
        flex-direction: column;
    }

    .new-baby-question {
        width: 100%;
    }

    .baby-answer-card {
        padding: 20px;
    }
}

/* === FPC ENGINEERING PRODUCT IDENTIFICATION === */
.fpc-engineering-section {
    padding-bottom: 72px;
}

.fpc-pending-question {
    margin: 20px 0 16px;
    padding: 16px 18px;
    border-left: 4px solid #d5232e;
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    color: #19253a;
}

.fpc-pending-question p {
    margin: 8px 0;
}

.fpc-pending-question a,
.fpc-quote-honesty {
    font-size: .88rem;
}

.fpc-product-sheet,
.fpc-clarification-panel {
    margin-top: 26px;
    padding: 30px;
    border: 1px solid #dfe5ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(17, 30, 52, .06);
}

.fpc-product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e5eaf0;
}

.fpc-product-kicker {
    color: #bf2029;
    font-size: .77rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.fpc-product-header h2,
.fpc-clarification-panel h2 {
    margin: 10px 0 12px;
    color: #14243b;
}

.fpc-product-reference,
.fpc-private-reference {
    margin: 6px 0;
    color: #46556b;
}

.fpc-confirmed-badge,
.fpc-made-to-order {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eaf6ee;
    color: #21663b;
    font-size: .8rem;
    font-weight: 700;
}

.fpc-specification-section,
.fpc-datasheet-panel,
.fpc-fulfilment-panel {
    margin-top: 26px;
}

.fpc-datasheet-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px;
    border: 1px solid #cfd9e6;
    border-radius: 9px;
    background: #f4f7fb;
}

.fpc-datasheet-panel h3,
.fpc-datasheet-panel p {
    margin: 6px 0 0;
}

.fpc-datasheet-panel p {
    max-width: 620px;
    color: #58677a;
}

.fpc-datasheet-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 9px;
    min-width: 215px;
}

.fpc-datasheet-actions a {
    display: block;
    padding: 11px 15px;
    border: 1px solid #0d2d59;
    border-radius: 7px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.fpc-datasheet-download {
    background: #0d2d59;
    color: #fff;
}

.fpc-datasheet-print {
    background: #fff;
    color: #0d2d59;
}

.fpc-datasheet-actions a:hover,
.fpc-datasheet-actions a:focus-visible {
    border-color: #c4212a;
    outline: 2px solid transparent;
}

.fpc-specification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin: 14px 0 0;
}

.fpc-specification-row {
    padding: 14px 16px;
    border: 1px solid #e9edf2;
    border-radius: 8px;
    background: #f9fafc;
}

.fpc-specification-row dt {
    margin-bottom: 6px;
    color: #58677a;
    font-size: .83rem;
}

.fpc-specification-row dd {
    margin: 0;
    color: #18283e;
    font-weight: 700;
}

.fpc-fulfilment-panel {
    padding: 18px;
    border-left: 4px solid #d5232e;
    border-radius: 8px;
    background: #fff7f7;
}

.fpc-made-to-order {
    background: #fff0da;
    color: #815117;
}

.fpc-quote-honesty,
.fpc-candidate-note,
.fpc-product-footer {
    color: #687587;
}

.fpc-product-footer {
    margin-top: 22px;
    font-size: .82rem;
}

.fpc-conversation-reply {
    display: inline-block;
    margin-top: 14px;
    padding: 11px 16px;
    border-radius: 7px;
    background: #c4212a;
    color: #fff;
    text-decoration: none;
}

.fpc-conversation-history {
    margin-top: 28px;
    padding: 18px 0;
    border-top: 1px solid #e2e7ef;
}

.fpc-candidate-section {
    margin-top: 28px;
}

.fpc-candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 14px;
}

.fpc-candidate-card {
    padding: 16px;
    border: 1px solid #e2e7ef;
    border-radius: 9px;
    background: #fff;
}

.fpc-candidate-card h4,
.fpc-candidate-card p {
    margin: 7px 0;
}

.fpc-candidate-card p span {
    color: #607084;
}

.fpc-conversation-entry {
    margin: 8px 0;
    color: #32445a;
}

@media (max-width: 650px) {
    .fpc-product-sheet,
    .fpc-clarification-panel {
        padding: 20px;
    }

    .fpc-product-header {
        flex-direction: column;
    }

    .fpc-datasheet-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .fpc-datasheet-actions {
        width: 100%;
    }
}
