:root {
    color-scheme: light;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color: #17213a;
    background: #f5f4f8;
    --purple: #4e2a84;
    --purple-dark: #35205c;
    --purple-soft: #eee9f6;
    --orange: #d86322;
    --green: #167352;
    --red: #b42318;
    --line: #dedbe6;
    --muted: #657086;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, #f0e9fa 0, transparent 32rem),
        #f5f4f8;
}

body [hidden] {
    display: none !important;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    border-radius: 8px;
    background: var(--purple);
    color: white;
    cursor: pointer;
    font-weight: 700;
    padding: 0.78rem 1.15rem;
}

button:hover:not(:disabled) {
    background: var(--purple-dark);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.secondary {
    border: 1px solid var(--line);
    background: white;
    color: var(--purple);
}

.training-banner {
    background: #27213c;
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.5rem 2rem;
    text-align: center;
}

.site-header {
    align-items: center;
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 76px;
    padding: 0.9rem 2.25rem;
}

.brand-lockup,
.staff-chip {
    align-items: center;
    display: flex;
    gap: 0.85rem;
}

.brand-lockup strong,
.staff-chip span {
    display: block;
}

.brand-mark {
    align-items: center;
    background: var(--purple);
    border-radius: 12px;
    color: white;
    display: flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    letter-spacing: 0.04em;
    width: 42px;
}

.staff-chip {
    background: var(--purple-soft);
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
}

.staff-chip small {
    color: var(--muted);
}

.eyebrow {
    color: var(--purple);
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

main {
    margin: 0 auto;
    max-width: 1600px;
    padding: 2rem;
}

.dashboard {
    display: grid;
    gap: 1.5rem;
}

.hero-card {
    align-items: center;
    background: linear-gradient(135deg, white 15%, #f0e9f8 100%);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(53, 32, 92, 0.07);
    display: flex;
    justify-content: space-between;
    padding: 2rem;
}

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

.hero-card h1 {
    font-size: clamp(1.8rem, 3vw, 2.75rem);
    letter-spacing: -0.035em;
    margin-bottom: 0.7rem;
}

.hero-card p {
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 0;
    max-width: 680px;
}

.path-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.path-card {
    align-items: center;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 1rem;
    grid-template-columns: auto 1fr auto;
    padding: 1.2rem;
}

.path-card.selected {
    border-color: #a28bc5;
    box-shadow: inset 4px 0 var(--purple);
}

.path-card.separate {
    background: #faf9fb;
}

.path-number {
    color: var(--orange);
    font-size: 0.78rem;
    font-weight: 800;
}

.path-card h2 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.path-card p {
    color: var(--muted);
    font-size: 0.86rem;
    margin-bottom: 0;
}

.path-status,
.count,
.save-state {
    background: var(--purple-soft);
    border-radius: 999px;
    color: var(--purple);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.4rem 0.7rem;
}

.queue-card,
.form-panel,
.source-panel,
.step-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.queue-card {
    overflow: hidden;
}

.section-heading,
.form-heading {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.section-heading h2,
.form-heading h1 {
    margin-bottom: 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #eeecf2;
    padding: 1rem 1.25rem;
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-ready,
.document-status.received {
    color: var(--green);
    font-weight: 800;
}

.application-shell {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 230px minmax(540px, 1fr) 310px;
}

.step-panel,
.source-panel {
    position: sticky;
    top: 1.25rem;
}

.step-panel {
    padding: 1.3rem;
}

.step-panel h2,
.source-panel h2 {
    margin-bottom: 0.35rem;
}

.form-reference {
    color: var(--muted);
    font-size: 0.8rem;
}

.step-panel ol {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
}

.step-panel li {
    border-left: 2px solid var(--line);
    color: var(--muted);
    font-size: 0.83rem;
    padding: 0.58rem 0 0.58rem 0.8rem;
}

.step-panel li.active {
    border-left-color: var(--purple);
    color: var(--purple);
    font-weight: 800;
}

.step-panel li.complete {
    color: var(--green);
}

.form-panel {
    min-height: 720px;
    overflow: hidden;
}

.form-heading h1 {
    font-size: 1.65rem;
}

.branch-note,
.form-error {
    border-radius: 8px;
    line-height: 1.5;
    margin: 1.25rem 1.5rem 0;
    padding: 0.85rem 1rem;
}

.branch-note {
    background: #f7f1e8;
    border: 1px solid #ead2b8;
    color: #72451e;
}

.form-error {
    background: #fff1f0;
    color: var(--red);
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

#application-form {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1.5rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field.wide {
    grid-column: 1 / -1;
}

.field > label,
.field legend {
    color: #354057;
    font-size: 0.82rem;
    font-weight: 700;
}

input,
select {
    background: white;
    border: 1px solid #bdb8c8;
    border-radius: 7px;
    color: #17213a;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    width: 100%;
}

input:focus,
select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(78, 42, 132, 0.12);
    outline: 0;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.radio-row {
    display: flex;
    gap: 0.7rem;
}

.radio-option {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: flex;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.55rem 0.8rem;
}

.radio-option input {
    min-height: auto;
    width: auto;
}

.form-actions {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: auto;
    padding: 1rem 1.5rem;
}

.source-panel {
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: 1.3rem;
}

.source-group {
    border-top: 1px solid var(--line);
    margin-top: 1rem;
    padding-top: 1rem;
}

.source-group h3 {
    font-size: 0.83rem;
    margin: 0 0 0.7rem;
}

.source-row {
    display: grid;
    gap: 0.12rem;
    margin-bottom: 0.7rem;
}

.source-row span {
    color: var(--muted);
    font-size: 0.69rem;
    text-transform: uppercase;
}

.source-row strong {
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

#document-list,
#review-panel {
    padding: 1.5rem;
}

.document-intro {
    background: var(--purple-soft);
    border-radius: 9px;
    color: var(--purple-dark);
    line-height: 1.5;
    margin-bottom: 1rem;
    padding: 1rem;
}

.document-card {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr auto auto;
    margin-bottom: 0.8rem;
    padding: 1rem;
}

.document-card h3 {
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
}

.document-card p {
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 0;
}

.document-status {
    color: var(--muted);
    font-size: 0.76rem;
}

.review-hero {
    background: linear-gradient(135deg, #e7f6ef, #f7fcf9);
    border: 1px solid #a9d7c4;
    border-radius: 12px;
    padding: 1.25rem;
}

.review-hero h2 {
    color: #0f6648;
    margin-bottom: 0.5rem;
}

.metric-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1.25rem 0;
}

.metric-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem;
}

.metric-card strong {
    display: block;
    font-size: 1.55rem;
}

.metric-card span {
    color: var(--muted);
    font-size: 0.75rem;
}

.human-boundary {
    background: #fff6ed;
    border: 1px solid #f5c79e;
    border-radius: 10px;
    padding: 1rem;
}

.human-boundary h3 {
    color: #8a4416;
    margin-bottom: 0.45rem;
}

.human-boundary p {
    color: #6f4c37;
    line-height: 1.5;
    margin-bottom: 0;
}

@media (max-width: 1180px) {
    .application-shell {
        grid-template-columns: 210px 1fr;
    }

    .source-panel {
        grid-column: 1 / -1;
        max-height: none;
        position: static;
    }
}

@media (max-width: 780px) {
    main,
    .site-header {
        padding: 1rem;
    }

    .staff-chip,
    .step-panel {
        display: none;
    }

    .hero-card,
    .path-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-card {
        gap: 1rem;
    }

    .application-shell {
        grid-template-columns: 1fr;
    }

    #application-form,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .field.wide {
        grid-column: auto;
    }
}
