:root {
    color-scheme: light;
    --background: #f5f7f8;
    --surface: #ffffff;
    --surface-subtle: #eef3f4;
    --border: #cdd8db;
    --text: #152124;
    --muted: #5d6d73;
    --accent: #0f766e;
    --warning: #9a5b00;
    --warning-bg: #fff4d8;
    --shadow: 0 14px 36px rgb(19 34 39 / 10%);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.site-nav {
    display: flex;
    width: min(1120px, calc(100% - 32px));
    min-height: 64px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.environment-banner {
    padding: 8px 16px;
    background: #23313f;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
}

.brand-link,
.nav-links a,
.logout-form button {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.nav-user {
    color: var(--muted);
    font-weight: 700;
}

.logout-form {
    margin: 0;
}

.logout-form button {
    min-height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.page-shell.narrow {
    max-width: 760px;
}

.readiness-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: 2.3rem;
    line-height: 1.12;
}

h2 {
    margin: 32px 0 16px;
    font-size: 1.35rem;
}

h3 {
    margin: 0;
    font-size: 1rem;
}

.lede {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.08rem;
}

.status-panel,
.setup-panel,
.summary-grid article,
.checklist li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.alert-success {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #9cc8bc;
    border-radius: 8px;
    background: #e7f6ef;
    color: #134f3d;
    font-weight: 700;
}

.status-panel {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 20px;
}

.status-panel div {
    display: grid;
    gap: 4px;
}

dt,
.summary-label {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
}

dd {
    margin: 0;
    font-weight: 700;
}

.status-badge,
.item-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--warning-bg);
    color: var(--warning);
    font-weight: 700;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.summary-grid article {
    display: grid;
    gap: 4px;
    padding: 20px;
}

.summary-count {
    font-size: 2rem;
    font-weight: 800;
}

.checklist {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checklist li {
    padding: 18px;
}

.item-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.item-marker {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--warning-bg);
    color: var(--warning);
    font-weight: 800;
}

.item-status {
    margin-left: auto;
    font-size: 0.88rem;
}

.checklist p {
    color: var(--muted);
}

.next-action {
    margin-bottom: 0;
}

.action-link,
.button-link,
button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-top: 12px;
    padding: 8px 14px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.setup-panel {
    margin-top: 24px;
    padding: 22px;
}

.field-group {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

label {
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
a:focus-visible,
button:focus-visible {
    outline: 3px solid rgb(15 118 110 / 35%);
    outline-offset: 2px;
}

select {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    background: var(--surface);
    font: inherit;
}

.field-group span,
.validation-summary {
    color: #9f1239;
    font-weight: 700;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.button-row a {
    color: var(--accent);
    font-weight: 700;
}

.details-list {
    display: grid;
    gap: 14px;
    margin: 0 0 18px;
}

.details-list div {
    display: grid;
    gap: 4px;
}

.page-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.page-heading h1 {
    margin-bottom: 0;
}

.inline-form,
.form-panel {
    display: grid;
    gap: 14px;
    margin-bottom: 22px;
}

.inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.inline-form label {
    grid-column: 1 / -1;
}

.field {
    display: grid;
    gap: 6px;
}

.field span {
    color: #9f1239;
    font-weight: 700;
}

.empty-state {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

.data-table th,
.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.86rem;
    text-transform: uppercase;
}

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

.status-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #9cc8bc;
    border-radius: 8px;
    background: #e7f6ef;
    color: #134f3d;
    font-weight: 700;
}

.detail-list {
    display: grid;
    gap: 14px;
    margin: 0 0 24px;
}

.detail-list div {
    display: grid;
    gap: 4px;
}

.candidate-shell {
    background: #f8faf9;
}

.candidate-page-shell {
    max-width: 760px;
}

.candidate-invitation-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.compact-detail-list {
    margin-top: 22px;
}

.plain-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 22px;
    color: var(--muted);
}

.checkbox-field {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.checkbox-field input {
    width: 20px;
    min-height: 20px;
    margin-top: 2px;
}

.source-audio-list {
    display: grid;
    gap: 12px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.source-audio-review {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-subtle);
}

.source-audio-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    justify-content: space-between;
}

.source-audio-summary span {
    color: var(--muted);
}

.source-audio-player audio {
    width: 100%;
}

.source-audio-approval,
.source-audio-retire {
    margin: 0;
}

.source-audio-approval {
    display: grid;
    gap: 8px;
}

.preflight-panel {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.preflight-controls {
    align-items: stretch;
}

.preflight-controls button,
.preflight-form button {
    margin-top: 0;
}

button:disabled {
    border-color: var(--border);
    background: var(--surface-subtle);
    color: var(--muted);
    cursor: not-allowed;
}

.preflight-playback {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-subtle);
}

.preflight-playback[hidden] {
    display: none;
}

.preflight-playback h2 {
    margin: 0;
    font-size: 1.1rem;
}

.preflight-playback audio {
    width: 100%;
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 24px, 1120px);
        padding: 24px 0;
    }

    .readiness-header,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.8rem;
    }

    .item-status {
        margin-left: 0;
    }
}
