* { box-sizing: border-box; }

:root {
    background: #f4f6f9;
    color: #1b2938;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body { margin: 0; padding: 2rem 1rem; }
body.signed-in { padding: 0; background: #f4f6f9; }

a { color: #176b73; text-underline-offset: .2em; }
a:hover { color: #0d4d59; }

.skip { position: absolute; left: -10000px; }
.skip:focus { z-index: 20; top: .75rem; left: .75rem; padding: .5rem .75rem; background: #fff; border-radius: .4rem; box-shadow: 0 4px 14px #0e1d2b33; }

.card {
    width: 100%;
    max-width: 36rem;
    margin: auto;
    padding: clamp(1rem, 4vw, 2.5rem);
    background: #fff;
    border: 1px solid #d8e0e7;
    border-radius: .9rem;
    box-shadow: 0 12px 30px #172c4010;
}

header { border-bottom: 1px solid #dce4ea; margin-bottom: 1.5rem; }
header strong { font-size: 1.5rem; }

.app-frame { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    width: 16.5rem;
    height: 100vh;
    flex: 0 0 16.5rem;
    flex-direction: column;
    padding: 1.25rem .8rem .9rem;
    background: #102b3a;
    color: #dcecf0;
}

.sidebar-brand { padding: .15rem .45rem 1.7rem; }
.sidebar-brand a, .account-link { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.sidebar-brand strong { display: block; color: #fff; font-size: 1.18rem; letter-spacing: -.02em; }
.sidebar-brand small, .account-link small { display: block; color: #a9c4cc; font-size: .72rem; }

.brand-mark, .avatar {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    place-items: center;
    border-radius: .58rem;
    background: #2a9d9b;
    color: #fff;
    font-size: .95rem;
    font-weight: 850;
}

.sidebar-nav { display: grid; gap: .2rem; }
.sidebar-section { display: grid; gap: .2rem; }
.sidebar-section + .sidebar-section { margin-top: .9rem; }
.sidebar-section-label { margin: 0; padding: .2rem .75rem .1rem; color: #8eafb8; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .75rem;
    min-height: 2.65rem;
    border-radius: .5rem;
    color: #c1d7dc;
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.sidebar-nav a:hover { background: #1a4253; color: #fff; }
.sidebar-nav a:focus-visible { outline: 2px solid #7fe3db; outline-offset: 2px; }
.sidebar-nav a.active { background: #e8f4f3; color: #144b55; box-shadow: inset 3px 0 #2a9d9b; }
.nav-icon { display: inline-grid; width: 1.05rem; height: 1.05rem; flex: 0 0 1.05rem; place-items: center; color: currentColor; font-size: 1rem; font-weight: 800; line-height: 1; text-align: center; }
.sidebar-secondary { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid #315364; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-bottom: 1rem; color: #607582; font-size: .78rem; }
.breadcrumbs a { color: #236d75; font-weight: 750; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: #314f5b; font-weight: 800; }
.breadcrumbs-separator { color: #8ca0a8; }

.sidebar-account { margin-top: auto; padding: 1rem .45rem .1rem; border-top: 1px solid #315364; }
.account-link { min-width: 0; }
.account-link > span:last-child { min-width: 0; }
.account-link strong { display: block; color: #fff; font-size: .84rem; }
.account-link small { overflow: hidden; max-width: 11rem; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 1.85rem; height: 1.85rem; flex-basis: 1.85rem; border-radius: 50%; background: #305e6d; font-size: .78rem; }
.sidebar-account form { margin: .5rem 0 0; }
.logout-button { width: auto; margin: 0; padding: .3rem 0; border: 0; background: transparent; color: #a9c4cc; font-size: .78rem; font-weight: 650; }
.logout-button:hover { color: #fff; text-decoration: underline; }

.app-workspace { min-width: 0; flex: 1; }
.topbar {
    display: flex;
    height: 3.6rem;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1rem, 3vw, 2.5rem);
    border-bottom: 1px solid #dfe6eb;
    background: #fff;
    color: #607582;
    font-size: .82rem;
    font-weight: 750;
}
.topbar-status { display: inline-flex; align-items: center; gap: .35rem; }
.topbar-status::before { width: .45rem; height: .45rem; border-radius: 50%; background: #27926e; content: ""; }
.app-content { width: min(100%, 92rem); margin: 0 auto; padding: clamp(1.25rem, 3.2vw, 2.5rem); }

h1, h2, h3 { color: #142a3a; line-height: 1.2; }
h1 { margin: .1rem 0; font-size: clamp(1.7rem, 3vw, 2.25rem); letter-spacing: -.035em; }
h2 { margin: 0; font-size: 1.13rem; }
h3 { font-size: 1rem; }
p { margin: .5rem 0; }
small, .muted { color: #647786; }

form, nav, details { margin: 1rem 0; }
label { display: block; margin-top: .8rem; color: #344e5d; font-size: .82rem; font-weight: 750; }
input, select, textarea {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .62rem .7rem;
    border: 1px solid #bccbd4;
    border-radius: .45rem;
    color: #1b2938;
    font: inherit;
    background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: #2a8c90; outline: 3px solid #cdebea; }
textarea { min-height: 5rem; resize: vertical; }
button, .button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .64rem .9rem;
    border: 1px solid #176b73;
    border-radius: .45rem;
    background: #176b73;
    color: #fff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
}
button { margin-top: .8rem; }
button:hover, .button-link:hover { border-color: #0d4d59; background: #0d4d59; color: #fff; }
.secondary { border-color: #b9c8d1; background: #fff; color: #176b73; }

.page-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.page-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.page-heading p, .section-heading p { color: #667a88; }
.eyebrow { margin: 0 0 .3rem; color: #20777b; font-size: .72rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }

.home-context {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    margin: .9rem 0 0;
    color: #647786;
    font-size: .83rem;
}
.home-context strong { color: #294553; }
.context-separator { color: #a1b1bb; }
.profile-pill { display: inline-flex; max-width: 22rem; overflow: hidden; padding: .18rem .5rem; border: 1px solid #c8d9dc; border-radius: 999px; background: #f0f8f8; color: #23646b; font-size: .75rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(8.5rem, 1fr)); gap: .65rem; margin: 1.2rem 0; }
.metric-grid article, .summary-grid article, .activity-grid article, .config-grid article {
    padding: .9rem 1rem;
    border: 1px solid #dce5e9;
    border-radius: .65rem;
    background: #fff;
    box-shadow: 0 2px 5px #162e3e08;
}
.metric-grid span, .summary-grid span, .activity-grid span { display: block; color: #687b88; font-size: .68rem; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
.metric-grid strong { display: block; margin: .3rem 0 .12rem; color: #133c50; font-size: 1.45rem; line-height: 1; }
.metric-grid small, .activity-grid small { display: block; font-size: .75rem; }

.section-panel { margin: 1.1rem 0; padding: 1.2rem; border: 1px solid #dce5e9; border-radius: .75rem; background: #fff; box-shadow: 0 3px 12px #172c4009; }
.opportunities-panel { padding: 1.15rem; }
.activity-panel { background: #fbfcfd; }
.activity-grid, .summary-grid, .config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .7rem; }
.summary-grid { margin: 1rem 0; }
.summary-grid strong, .activity-grid strong { display: block; margin-top: .3rem; font-size: 1rem; }
.decision-summary { padding: .85rem; border: 1px solid #b9d7d9; border-radius: .75rem; background: #edf8f7; }
.decision-summary article { border-color: #cfe3e4; box-shadow: none; }

.config-grid { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.config-grid article { min-height: 11.5rem; }
.config-grid article a, .config-grid article .muted { margin-top: auto; }
.config-grid ul { padding-left: 1.2rem; }
.config-grid h2 { margin-bottom: .35rem; }
.config-section-heading { grid-column: 1 / -1; margin-top: .65rem; padding-top: .35rem; border-top: 1px solid #dce5e9; }
.config-section-heading:first-child { margin-top: 0; border-top: 0; }
.config-section-heading h2 { margin: 0; color: #355563; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .7rem; align-items: end; margin: 1rem 0 1.25rem; padding: 1rem; border: 1px solid #dce5e9; border-radius: .65rem; background: #fff; }
.filters label { margin: 0; }
.filter-actions { display: flex; align-items: end; gap: .75rem; padding-top: .15rem; }
.filter-actions button { margin: 0; }
.profile-form { max-width: 76rem; margin: 0 auto; }
.profile-section { margin: 1.1rem 0; padding: clamp(1rem, 2.5vw, 1.5rem); border: 1px solid #dce5e9; border-radius: .75rem; background: #fff; box-shadow: 0 3px 12px #172c4009; }
.profile-section .section-heading { margin-bottom: .6rem; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; align-items: start; }
.profile-grid > label { margin: 0; }
.checkbox-field { display: flex; gap: .55rem; align-items: center; min-height: 2.85rem; padding: .55rem .65rem; border: 1px solid #d5e0e6; border-radius: .45rem; background: #fbfcfd; }
.checkbox-field input { width: auto; margin: 0; }
.advanced-section { margin: 1rem 0 0; padding: .3rem .9rem .9rem; border: 1px solid #d7e2e7; border-radius: .55rem; background: #fbfcfd; }
.advanced-section summary { color: #176b73; }
.field-error { display: block; margin-top: .35rem; color: #a33d3d; font-size: .78rem; font-weight: 700; }
.buyer-selector-grid { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.buyer-selector { min-width: 0; padding: .9rem; border: 1px solid #d7e3e8; border-radius: .6rem; background: #fbfcfd; }
.buyer-selector h3 { margin: 0; }
.buyer-selector .buyer-all-regions { margin-top: .55rem; font-size: .76rem; }
.buyer-options { max-height: 19rem; overflow: auto; margin-top: .65rem; border: 1px solid #d7e2e7; border-radius: .5rem; background: #fff; }
.buyer-option { display: flex; gap: .55rem; margin: 0; padding: .65rem .7rem; border-bottom: 1px solid #e4ebee; cursor: pointer; }
.buyer-option:last-child { border-bottom: 0; }
.buyer-option:hover { background: #f0f8f8; }
.buyer-option input { width: auto; height: min-content; margin: .18rem 0 0; }
.buyer-option strong, .buyer-option small { display: block; }
.buyer-option small { margin-top: .1rem; color: #657987; font-size: .72rem; font-weight: 500; }
.buyer-empty { margin: .65rem 0 0; color: #7a5560; font-size: .82rem; }
.buyer-selected { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 2rem; margin-top: .65rem; color: #687b88; font-size: .78rem; }
.buyer-chip { display: inline-flex; max-width: 100%; align-items: center; gap: .35rem; padding: .25rem .4rem .25rem .55rem; border: 1px solid #a9d2d3; border-radius: 999px; background: #eaf7f6; color: #145961; font-weight: 700; }
.buyer-chip-remove { width: 1.25rem; height: 1.25rem; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #145961; font-size: 1rem; line-height: 1; }
.buyer-chip-remove:hover { background: #b9dedf; color: #143f45; }
.profile-summary { margin: 1.1rem 0; padding: 1rem 1.15rem; border: 1px solid #b9d9da; border-radius: .7rem; background: #eef9f8; }
.profile-summary p { color: #3d6670; }
.profile-summary ul { margin: .55rem 0 0; padding-left: 1.2rem; }
.profile-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .55rem; margin: 0 0 1rem; padding: .8rem; border: 1px solid #d7e2e7; border-radius: .55rem; background: #fbfcfd; }
.profile-mode legend { grid-column: 1 / -1; padding: 0 .25rem; font-weight: 750; }
.profile-mode p { grid-column: 1 / -1; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.filter-tabs { display: flex; gap: .4rem; overflow-x: auto; margin: 0 0 1rem; padding: 0 0 .3rem; }
.filter-tabs a { flex: 0 0 auto; padding: .42rem .65rem; border: 1px solid #c8d5dc; border-radius: 999px; color: #506977; font-size: .8rem; font-weight: 750; text-decoration: none; }
.filter-tabs a:hover, .filter-tabs a.active { border-color: #238187; background: #e7f5f4; color: #155d66; }
.filter-tabs .tab-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.notice-panel { border-left: .25rem solid #238187; background: #f3fbfa; }

.opportunity-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; padding: .35rem; border: 1px solid #dce5e9; border-radius: .6rem; background: #f8fbfb; }
.opportunity-tabs a { padding: .45rem .7rem; border-radius: .4rem; color: #42616d; font-size: .82rem; font-weight: 750; text-decoration: none; }
.opportunity-tabs a:hover, .opportunity-tabs a:focus-visible { background: #e4f4f2; color: #145961; }
.scenario-card { margin: .8rem 0; padding: 1rem; border: 1px solid #dce5e9; border-radius: .65rem; background: #fbfcfd; }
.scenario-card .section-heading { margin-bottom: .6rem; }
.scenario-card h3 { margin: 0; }
.scenario-card .summary-grid { margin-bottom: .6rem; }
.status-pill { display: inline-flex; padding: .16rem .45rem; border: 1px solid #b9d7d9; border-radius: 999px; background: #edf8f7; color: #245d63; font-size: .72rem; font-weight: 800; }
.warning-text { padding: .6rem .75rem; border-left: 3px solid #d3a352; background: #fff8e9; color: #78580f; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.inline-form label { margin: 0; min-width: 8rem; }
.inline-form button { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .7rem; }
.form-grid label { margin: 0; }
.form-grid .form-actions { display: flex; align-items: end; gap: .7rem; grid-column: 1 / -1; }
.form-grid .form-actions button { margin: 0; }
.compact-form { margin: .6rem 0 0; }
.config-card-wide { grid-column: 1 / -1; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid #dce5e9; border-radius: .55rem; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { padding: .78rem .8rem; border-bottom: 1px solid #e4eaee; text-align: left; vertical-align: top; }
th { background: #f7f9fa; color: #5a707e; font-size: .68rem; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
td { min-width: 7rem; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f5fbfb; }
tbody tr:last-child td { border-bottom: 0; }
td > strong { color: #203d4c; }

.badge { display: inline-flex; align-items: center; padding: .18rem .48rem; border: 1px solid #aabcc5; border-radius: 999px; background: #f0f4f6; color: #496371; font-size: .7rem; font-weight: 850; line-height: 1.35; }
.high, .reproducible-candidate, .complete, .confirmed, .covered, .candidate { border-color: #62a17b; background: #ebf7ef; color: #287047; }
.medium, .low, .incomplete, .requires-review, .unknown, .pending { border-color: #d3a352; background: #fff8e9; color: #86600f; }
.not-evaluable, .no-supply, .not-reproducible { border-color: #cb8585; background: #fff4f3; color: #984546; }
.stock, .workflow, .not-applicable { border-color: #aebdc7; background: #f0f4f6; color: #496371; }

.notice { margin: 0 0 1rem; padding: .75rem 1rem; border-left: 4px solid #31916e; border-radius: .35rem; background: #edf9f1; color: #245d3d; }
.alert { margin: 1rem 0; padding: .7rem 1rem; border-left: 4px solid #bc6767; border-radius: .35rem; background: #fff3f3; }
.empty-state { margin: .2rem 0; padding: 2rem clamp(1.25rem, 4vw, 3rem); border: 1px dashed #adbdc7; border-radius: .65rem; background: linear-gradient(135deg, #fcfefe, #f3faf9); text-align: center; }
.empty-state h2 { margin-bottom: .5rem; }
.empty-state .empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; margin-top: 1rem; }

.breadcrumb { color: #6a7f8c; font-size: .84rem; }
.breadcrumb span { padding: 0 .35rem; }
.section { margin: 1.5rem 0; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; margin: 0; }
.details-grid div { padding: .75rem; border: 1px solid #e1e8ec; border-radius: .5rem; background: #fbfcfd; }
dt { color: #687b88; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.quality-list { margin: 0; padding-left: 1.25rem; }
.quality-list li { margin: .35rem 0; }
.pagination { display: flex; flex-wrap: wrap; gap: .5rem; padding-left: 0; list-style: none; }
.pagination a, .pagination span { display: inline-block; padding: .42rem .65rem; border: 1px solid #ccd8df; border-radius: .35rem; text-decoration: none; }
summary { cursor: pointer; color: #176b73; font-weight: 750; padding: .5rem 0; }
img { max-width: 100%; height: auto; }
.codes { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid #e0af54; outline-offset: 3px; }

.extraction-page { width: min(100%, 112rem); margin: 0 auto; }
.extraction-heading, .extraction-section-heading, .extraction-review-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.extraction-heading { margin-bottom: 1.1rem; }
.extraction-section-heading { margin-bottom: .8rem; }
.extraction-layout { display: grid; grid-template-columns: minmax(19rem, .82fr) minmax(0, 1.45fr); gap: 1rem; align-items: start; }
.extraction-source-card, .extraction-requirements, .extraction-matrix-card, .extraction-review-card { min-width: 0; padding: 1rem; border: 1px solid #dce5e9; border-radius: .75rem; background: #fff; box-shadow: 0 3px 12px #172c4009; }
.extraction-source-card { position: sticky; top: 1rem; }
.extraction-pdf { display: block; width: 100%; height: min(72vh, 52rem); border: 1px solid #cbd9df; border-radius: .45rem; background: #eef2f4; }
.extraction-help { margin: .7rem 0 0; font-size: .78rem; }
.extraction-matrix-card { margin-bottom: 1rem; background: #f8fbfb; }
.extraction-matrix-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; align-items: end; }
.extraction-matrix-form label { margin: 0; }
.extraction-matrix-form button { margin: 0; white-space: nowrap; }
.extraction-card-list { display: grid; gap: .9rem; }
.extraction-review-card { border-left: 4px solid #d3a352; }
.extraction-review-card:not(.is-pending) { border-left-color: #62a17b; }
.extraction-review-header h3 { margin: .15rem 0 0; overflow-wrap: anywhere; }
.extraction-review-header p { margin: .25rem 0 0; }
.extraction-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin: .9rem 0; }
.extraction-detail-grid > div { min-width: 0; padding: .65rem; border: 1px solid #e2eaed; border-radius: .45rem; background: #fbfcfd; }
.extraction-detail-grid dd { overflow-wrap: anywhere; }
.extraction-evidence { margin: .8rem 0; padding: .8rem; border: 1px solid #d5e5e5; border-radius: .55rem; background: #f6fbfb; }
.extraction-evidence h4 { margin: 0; color: #214a56; font-size: .9rem; }
.extraction-evidence blockquote { margin: .55rem 0; padding: .65rem .8rem; border-left: 3px solid #6aafb0; background: #fff; overflow-wrap: anywhere; white-space: pre-wrap; }
.extraction-evidence ul { margin-bottom: 0; padding-left: 1.2rem; }
.extraction-correction { color: #805c12; overflow-wrap: anywhere; }
.extraction-review-form { display: grid; grid-template-columns: minmax(10rem, .8fr) minmax(12rem, 1fr) minmax(15rem, 1.6fr) auto; gap: .65rem; align-items: end; margin: 1rem 0 .5rem; }
.extraction-review-form label { margin: 0; }
.extraction-review-form textarea { min-height: 2.75rem; }
.extraction-review-form button { margin: 0; white-space: nowrap; }
.extraction-history { margin-top: .75rem; }
.extraction-history-row { display: flex; flex-wrap: wrap; gap: .4rem .8rem; padding: .45rem 0; border-top: 1px solid #e2eaed; color: #5e7280; font-size: .78rem; overflow-wrap: anywhere; }
.extraction-placeholder { padding: 1rem; border: 1px dashed #b8c8d0; border-radius: .5rem; background: #f8fafb; color: #5e7280; }

.validation-station { width: min(100%, 118rem); margin: -0.35rem auto 0; }
.validation-heading, .validation-section-heading, .validation-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.validation-heading { align-items: center; margin-bottom: .65rem; }
.validation-heading h1 { margin: .1rem 0 .25rem; }
.validation-heading .muted { margin: 0; font-size: .78rem; }
.validation-section-heading { align-items: center; margin-bottom: .55rem; }
.validation-section-heading h2 { margin: 0; }
.validation-summary, .validation-progress, .validation-document-context, .validation-list-panel, .validation-detail-panel, .validation-next-stage { min-width: 0; padding: .75rem; border: 1px solid #dce5e9; border-radius: .55rem; background: #fff; box-shadow: 0 2px 8px #172c4008; }
.validation-summary, .validation-progress, .validation-document-context { margin-bottom: .7rem; }
.validation-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; margin: 0; }
.validation-summary-grid > div, .validation-detail-grid > div { min-width: 0; padding: .5rem .55rem; border: 1px solid #e2eaed; border-radius: .35rem; background: #fbfcfd; }
.validation-summary-grid dd, .validation-detail-grid dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.validation-summary-note { margin: .55rem 0 0; font-size: .78rem; }
.validation-state { display: inline-block; max-width: 24rem; padding: .3rem .55rem; border: 1px solid #e1c27c; border-radius: 99rem; background: #fff8e9; color: #805c12; font-size: .78rem; font-weight: 750; text-align: center; }
.validation-progress-bar { height: .45rem; overflow: hidden; border-radius: 99rem; background: #e8eef0; }
.validation-progress-bar span { display: block; height: 100%; border-radius: inherit; background: #3d8c86; }
.validation-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .45rem; margin-top: .55rem; }
.validation-metric { display: grid; gap: .12rem; padding: .45rem .55rem; border: 1px solid #e2eaed; border-radius: .35rem; background: #fbfcfd; }
.validation-metric strong { display: block; color: #214a56; font-size: 1.15rem; line-height: 1.1; }
.validation-metric span { color: #687b88; font-size: .78rem; }
.validation-quality-warning { margin: .55rem 0 0; padding: .5rem .65rem; border-left: 3px solid #d3a352; background: #fff8e9; color: #805c12; font-size: .82rem; }
.validation-top-warning { margin: .45rem 0; padding: .45rem .7rem; font-size: .82rem; }
.validation-derived-note { margin: .55rem 0 0; padding: .45rem .6rem; border-left: 3px solid #6aafb0; background: #f1f9f8; color: #285d65; font-size: .82rem; }
.validation-derived-note span { color: #647786; }
.validation-comparison { margin-top: .65rem; padding-top: .55rem; border-top: 1px solid #e2eaed; }
.validation-comparison h3 { margin: 0 0 .4rem; font-size: .86rem; }
.validation-comparison-grid { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 1fr) minmax(8rem, 1fr) auto; gap: 0; border: 1px solid #e2eaed; border-radius: .35rem; overflow: hidden; font-size: .78rem; }
.validation-comparison-grid > div { min-width: 0; padding: .4rem .5rem; border-bottom: 1px solid #e2eaed; overflow-wrap: anywhere; }
.validation-comparison-grid > div:nth-last-child(-n + 4) { border-bottom: 0; }
.validation-comparison-head { background: #f7f9fa; color: #687b88; font-size: .68rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.validation-comparison-grid small { display: block; margin-top: .2rem; color: #647786; font-size: .7rem; }
.validation-pending-label { color: #805c12; font-weight: 750; white-space: nowrap; }
.validation-document-context { background: #f8fbfb; }
.validation-pdf { display: block; width: 100%; height: min(62vh, 44rem); margin-top: .55rem; border: 1px solid #cbd9df; border-radius: .45rem; background: #eef2f4; }
.validation-document-context details > p { margin-bottom: 0; }
.validation-workspace { display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); gap: .75rem; align-items: start; }
.validation-list-panel { position: sticky; top: .75rem; }
.validation-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin: 0 0 .55rem; padding: .5rem; border: 1px solid #e2eaed; border-radius: .4rem; background: #f8fafb; }
.validation-filters label, .validation-matrix-form label { margin: 0; }
.validation-filters label { font-size: .74rem; }
.validation-filters select { margin-top: .2rem; padding: .45rem .5rem; font-size: .8rem; }
.validation-requirement-list { display: grid; gap: .2rem; max-height: min(68vh, 42rem); overflow-y: auto; padding-right: .2rem; }
.validation-category-heading { padding: .45rem .2rem .15rem; border-bottom: 1px solid #dce5e9; color: #214a56; font-size: .74rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.validation-requirement-row { display: grid; grid-template-columns: 1.8rem minmax(7rem, 1.05fr) minmax(6rem, 1.35fr) auto auto auto; gap: .4rem; align-items: center; width: 100%; min-height: 2.65rem; margin: 0; padding: .42rem .45rem; border: 0; border-bottom: 1px solid #e5ecef; border-radius: .2rem; background: #fff; color: #193542; font-size: .8rem; font-weight: 500; text-align: left; cursor: pointer; }
.validation-requirement-row:hover { background: #f7fbfb; color: #193542; }
.validation-requirement-row[aria-selected="true"] { border-left: 3px solid #3d8c86; background: #eef8f7; color: #193542; }
.validation-row-number { color: #687b88; font-size: .78rem; font-weight: 800; }
.validation-row-main { display: grid; gap: .1rem; min-width: 0; }
.validation-row-main strong, .validation-row-value { overflow-wrap: anywhere; }
.validation-row-main small { color: #687b88; }
.validation-row-value { overflow: hidden; color: #48606c; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.validation-required { color: #805c12; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.validation-alert-icon { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #fff0cf; color: #805c12; font-weight: 900; }
.validation-detail-panel { min-height: 25rem; }
.validation-detail[hidden] { display: none; }
.validation-detail-heading h2 { margin: .15rem 0 0; }
.validation-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin: .65rem 0; }
.validation-evidence { margin: .6rem 0; padding: .65rem; border: 1px solid #d5e5e5; border-radius: .45rem; background: #f6fbfb; }
.validation-evidence h3 { margin: 0; color: #214a56; font-size: .9rem; }
.validation-evidence blockquote { margin: .55rem 0; padding: .65rem .8rem; border-left: 3px solid #6aafb0; background: #fff; overflow-wrap: anywhere; white-space: pre-wrap; }
.validation-evidence p { margin: .45rem 0 .7rem; }
.validation-page-link { display: inline-block; font-size: .82rem; }
.validation-correction { padding: .65rem .8rem; border-left: 3px solid #d3a352; background: #fff8e9; color: #805c12; overflow-wrap: anywhere; }
.validation-alert-reasons { margin: .55rem 0; padding: .45rem .6rem; border-left: 3px solid #d3a352; background: #fff8e9; color: #805c12; font-size: .8rem; }
.validation-alert-reasons strong { display: block; }
.validation-alert-reasons ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.validation-technical-info { margin-top: .55rem; }
.validation-technical-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: .35rem 0 0; }
.validation-technical-grid > div { min-width: 0; padding: .45rem; border: 1px solid #e2eaed; border-radius: .35rem; background: #fbfcfd; }
.validation-technical-grid dd { overflow-wrap: anywhere; font-size: .78rem; }
.validation-review-form { display: grid; grid-template-columns: minmax(10rem, .8fr) minmax(12rem, 1fr) minmax(15rem, 1.6fr) auto; gap: .45rem; align-items: end; margin: .7rem 0 .4rem; padding-top: .55rem; border-top: 1px solid #e2eaed; }
.validation-review-form label { margin: 0; }
.validation-review-form input, .validation-review-form select, .validation-review-form textarea { margin-top: .2rem; padding: .48rem .55rem; font-size: .8rem; }
.validation-review-form textarea { min-height: 2.5rem; }
.validation-review-form button { margin: 0; padding: .5rem .7rem; white-space: nowrap; font-size: .8rem; }
.validation-history { margin-top: .75rem; }
.validation-history-row { display: flex; flex-wrap: wrap; gap: .4rem .8rem; padding: .45rem 0; border-top: 1px solid #e2eaed; color: #5e7280; font-size: .78rem; overflow-wrap: anywhere; }
.validation-next-stage { margin-top: 1rem; background: #f8fbfb; }
.validation-matrix-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; align-items: end; }
.validation-matrix-form button { margin: 0; white-space: nowrap; }
.validation-placeholder { padding: 1rem; border: 1px dashed #b8c8d0; border-radius: .5rem; background: #f8fafb; color: #5e7280; }
.validation-filter-empty { padding: 1rem; color: #5e7280; }

@media (max-width: 68rem) {
    .sidebar { width: 4.35rem; flex-basis: 4.35rem; padding-inline: .55rem; }
    .sidebar-brand { padding-inline: .6rem; }
    .sidebar-brand > a > span:last-child, .sidebar-nav a:not(.active)::after, .sidebar-nav a { font-size: 0; }
    .sidebar-nav a { justify-content: center; gap: 0; padding: .74rem; }
    .sidebar-nav .nav-icon { width: auto; font-size: 1.1rem; }
    .sidebar-section-label { width: 0; height: 0; overflow: hidden; padding: 0; font-size: 0; }
    .sidebar-section a { justify-content: center; gap: 0; padding: .74rem; font-size: 0; }
    .sidebar-account { padding-inline: .55rem; }
    .account-link > span:last-child, .logout-button { display: none; }
    .metric-grid { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
    .extraction-layout { grid-template-columns: minmax(0, 1fr); }
    .extraction-source-card { position: static; }
    .extraction-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .extraction-review-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .validation-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .validation-workspace { grid-template-columns: minmax(0, 1fr); }
    .validation-list-panel { position: static; }
    .validation-requirement-list { max-height: none; }
    .validation-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 42rem) {
    .app-frame { display: block; }
    .sidebar { position: static; width: 100%; height: auto; min-height: 0; flex-direction: row; align-items: center; padding: .6rem .7rem; }
    .sidebar-brand { padding: 0 .45rem 0 0; }
    .sidebar-secondary { margin: 0 0 0 auto; padding: 0; border: 0; }
    .sidebar-nav { display: flex; gap: .15rem; }
    .sidebar-nav a { padding: .55rem; }
    .sidebar-section { display: contents; }
    .sidebar-account { display: none; }
    .topbar { height: 3rem; }
    .app-content { padding: 1.15rem .85rem 2rem; }
    .page-heading, .section-heading { display: block; }
    .page-heading-actions { justify-content: flex-start; margin-top: .8rem; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: 1fr; }
    .filter-actions { align-items: stretch; flex-direction: column; }
    button, .button-link { width: 100%; }
    .extraction-heading, .extraction-section-heading, .extraction-review-header { display: block; }
    .extraction-heading .button-link, .extraction-section-heading .button-link { margin-top: .75rem; }
    .extraction-pdf { height: 65vh; }
    .extraction-matrix-form, .extraction-detail-grid, .extraction-review-form { grid-template-columns: 1fr; }
    .validation-heading, .validation-section-heading, .validation-detail-heading { display: block; }
    .validation-heading .button-link, .validation-section-heading .button-link { margin-top: .75rem; }
    .validation-summary-grid, .validation-detail-grid, .validation-filters, .validation-review-form, .validation-matrix-form { grid-template-columns: 1fr; }
    .validation-comparison-grid, .validation-technical-grid { grid-template-columns: 1fr 1fr; }
    .validation-comparison-head { display: none; }
    .validation-comparison-grid > div:nth-child(4n + 1) { grid-column: 1 / -1; background: #f7f9fa; }
    .validation-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .validation-requirement-row { grid-template-columns: 1.8rem minmax(0, 1fr) auto; }
    .validation-row-value, .validation-required { grid-column: 2 / -1; }
    .validation-alert-icon { grid-column: 3; grid-row: 1; }
}
