.candidate-review-page {
    max-width: 1100px;
    margin: 48px auto;
    padding: 30px;
    color: white;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.candidate-review-page .page-heading {
    max-width: 100%;
    margin: 0 0 12px;
}

.candidate-review-lede {
    margin-bottom: 20px;
}

.candidate-review-page [hidden] {
    display: none;
}

.candidate-review-sections {
    box-sizing: border-box;
    width: 100%;
    margin: 20px auto 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    color: #1e293b;
    text-align: left;
}

.candidate-review-sections > .analysis-page-section {
    box-sizing: border-box;
    width: 100%;
    padding: 18px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.candidate-review-sections > .analysis-page-section + .analysis-page-section {
    border-top: 1px solid #e2e8f0;
}

.candidate-review-sections h2 {
    margin: 0 0 12px;
    color: #0f172a;
}

.candidate-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 18px 0;
}

.candidate-toolbar {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: end;
}

.candidate-toolbar label {
    flex-direction: column;
    min-width: 0;
}

.candidate-controls .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 10px 18px;
    font: inherit;
    line-height: 1.4;
    text-align: center;
}

.candidate-controls label {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.candidate-toolbar label {
    align-items: stretch;
}

.candidate-overview > .candidate-controls {
    margin-top: 0;
}

.candidate-review-sections p + p {
    margin-top: 8px;
}

#candidate-market-status,
#candidate-status,
#candidate-monitor-context,
#candidate-count {
    color: #475569;
    overflow-wrap: anywhere;
}

#candidate-status {
    margin-bottom: 16px;
}

#candidate-count {
    margin: 16px 0 12px;
}

.candidate-controls a.action-button {
    background: #0d6efd;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
}

.candidate-controls a.action-button:hover {
    background: #0b5ed7;
}

.candidate-controls button.action-button:disabled {
    background: #e2e8f0;
    color: #475569;
    cursor: not-allowed;
}

.candidate-controls select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #1e293b;
    background: #fff;
    font: inherit;
}

.candidate-review-page a:not(.action-button) {
    color: #2563eb;
}

.candidate-review-page #candidate-market-status:empty,
.candidate-review-page #candidate-status:empty {
    display: none;
}

.candidate-guide {
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    overflow-wrap: anywhere;
}

.candidate-guide summary,
.candidate-card details summary,
.candidate-history-entry details summary {
    cursor: pointer;
}

.candidate-guide summary {
    color: #1e293b;
    font-weight: 600;
}

.candidate-guide p:last-child {
    margin-bottom: 0;
}

.candidate-guide[open] summary {
    margin-bottom: 12px;
}

.candidate-guide p {
    margin-top: 12px;
}

.candidate-summary {
    max-width: 760px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.candidate-summary-heading {
    padding: 16px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.candidate-summary-heading h2 {
    font-size: 1.125rem;
}

.candidate-summary-heading p {
    font-size: 0.875rem;
    line-height: 1.6;
}

.candidate-criteria {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 0;
    margin: 0;
}

.candidate-criteria dt,
.candidate-criteria dd {
    min-width: 0;
    margin: 0;
    padding: 11px 14px;
    border-bottom: 1px solid #e2e8f0;
    overflow-wrap: anywhere;
}

.candidate-criteria dt:last-of-type,
.candidate-criteria dd:last-of-type {
    border-bottom: 0;
}

.candidate-card .candidate-controls {
    align-items: stretch;
    margin-bottom: 0;
}

.candidate-card .candidate-controls > a:not(.action-button) {
    display: flex;
    align-items: center;
    min-height: 44px;
    min-width: 0;
}

#candidate-pagination {
    justify-content: center;
}

.candidate-criteria dt {
    color: #475569;
    font-weight: 600;
}

.candidate-criteria dd {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.candidate-list {
    display: grid;
    gap: 12px;
}

.candidate-card,
.candidate-history-entry {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow-wrap: anywhere;
}

.candidate-card h3,
.candidate-history-entry h3 {
    margin: 0 0 8px;
    color: #0f172a;
}

.candidate-badge {
    display: inline-block;
    margin: 0 0 4px;
    padding: 3px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: 0.875rem;
}

.candidate-card ul,
.candidate-history-entry ul {
    padding-left: 22px;
}

.candidate-card details,
.candidate-history-entry details {
    margin: 12px 0;
}

.candidate-card > details {
    padding: 12px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.candidate-history-entry {
    margin-bottom: 12px;
}

.candidate-review-page :focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
}

@media (min-width: 701px) {
    .candidate-toolbar {
        grid-template-columns: auto auto minmax(0, 360px);
        justify-content: start;
    }

    #candidate-monitor-panel > .candidate-toolbar {
        grid-template-columns: auto auto minmax(0, 240px);
    }
}

@media (max-width: 700px) {
    .candidate-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .candidate-toolbar label {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .candidate-toolbar .action-button {
        align-self: stretch;
        width: 100%;
        max-width: 100%;
    }

    .candidate-card .candidate-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .candidate-card .candidate-controls .action-button {
        width: 100%;
        max-width: 100%;
    }

    .candidate-card .candidate-controls > a:not(.action-button) {
        grid-column: 1 / -1;
    }

    .candidate-criteria {
        grid-template-columns: minmax(0, 1fr);
    }

    .candidate-criteria dd {
        border-bottom: 1px solid #cbd5e1;
        padding-top: 0;
    }

    .candidate-criteria dt:last-of-type,
    .candidate-criteria dd:last-of-type {
        border-bottom: 0;
    }
}

@media (max-width: 600px) {
    .candidate-review-page {
        width: calc(100% - 24px);
        margin: 24px auto;
        padding: 20px 14px;
    }

    .candidate-review-sections > .analysis-page-section {
        padding: 14px 10px;
    }
}

@media (max-width: 380px) {
    .candidate-toolbar,
    .candidate-card .candidate-controls {
        grid-template-columns: minmax(0, 1fr);
    }
}
