body {
    background: #f4f1ea;
}

.page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    color: #031634;
}

.page h1 {
    font-weight: 300;
    font-size: 40px;
    margin: 0 0 8px;
    color: #031634;
}

.lede {
    margin: 0 0 24px;
    max-width: 42rem;
    color: #3d4a57;
}

.panel {
    background: #fff;
    border: 1px solid #e4e0d8;
    border-radius: 12px;
    padding: 20px;
}

.sources {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

legend,
.field-label {
    display: block;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5c6b78;
    margin-bottom: 10px;
}

.source-toggle {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

label.choice {
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: none;
    letter-spacing: 0;
    color: #031634;
    font-size: 15px;
}

input[type="text"],
input[type="file"],
textarea {
    width: 100%;
    font: inherit;
    color: inherit;
}

input[type="text"],
textarea {
    border: 1px solid #cfc8bc;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

#analyze-btn {
    font: inherit;
    background: #031634;
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 10px 22px;
    cursor: pointer;
}

#analyze-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

#status {
    margin: 0;
    min-height: 1.4em;
    color: #8a2b2b;
}

.results {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 260px) minmax(0, 260px);
    gap: 16px;
    margin-top: 24px;
}

.results[hidden] {
    display: none;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.profile-photo {
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #e7eef8;
    color: #3d80bf;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-photo-icon {
    width: 46px;
    height: 46px;
}

.profile-initials {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #031634;
    color: #fff;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.profile-initials.is-shown {
    display: flex;
}

.profile-body {
    min-width: 0;
    flex: 1;
}

.profile-fields {
    display: grid;
    gap: 8px;
    margin: 0;
}

.profile-fields div {
    min-width: 0;
}

.profile-fields dt {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a93a0;
}

.profile-fields dd {
    margin: 1px 0 0;
    font-size: 16px;
    line-height: 1.3;
    color: #031634;
    overflow-wrap: anywhere;
}

#profile-name {
    font-size: 22px;
    font-weight: 500;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.profile-btn,
.profile-icon-btn {
    font: inherit;
    font-size: 14px;
    color: #031634;
    background: #fff;
    border: 1px solid #cfc8bc;
    border-radius: 999px;
    cursor: pointer;
}

.profile-btn {
    padding: 8px 14px;
}

.profile-btn:hover,
.profile-icon-btn:hover {
    background: #f4f1ea;
}

.profile-icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0a66c2;
    border-color: #b9d4ee;
    text-decoration: none;
}

.profile-icon-btn[aria-disabled="true"] {
    opacity: 0.4;
    pointer-events: none;
}

.profile-icon-btn svg {
    width: 18px;
    height: 18px;
}

.gauge-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border-radius: 12px;
}

#snap-gauge-panel,
#skill-gauge-panel {
    cursor: pointer;
}

.fit-popup-content {
    max-width: 720px;
}

.fit-popup-summary {
    margin: 8px 0 16px;
    color: #3d4a57;
    line-height: 1.5;
}

.fit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fit-table th,
.fit-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eeeae3;
    text-align: left;
}

.fit-table th {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5c6b78;
}

.fit-table td.fit-num,
.fit-table th:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fit-table tfoot td {
    font-weight: 500;
    border-bottom: 0;
}

.gauge-caption {
    margin: 0 0 4px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5c6b78;
}

.gauge {
    width: 100%;
    max-width: 220px;
    height: auto;
}

.skill-gap {
    grid-column: 1 / -1;
}

.match-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

#matched-percent {
    color: #1982c4;
}

#missing-percent {
    color: #c43b45;
}

.match-bar {
    display: flex;
    height: 16px;
    overflow: hidden;
    background: #e6e2da;
}

#match-bar-matched {
    background: #1982c4;
    height: 100%;
}

#match-bar-missing {
    background: rgb(255, 89, 94);
    height: 100%;
}

.skill-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 20px;
}

.skill-column-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5c6b78;
}

.skill-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.skill-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eeeae3;
}

.skill-list .skill-empty {
    color: #8a93a0;
    border-bottom: 0;
}

.coverage-panel {
    grid-column: 1 / -1;
    cursor: pointer;
}

.coverage-skill-block {
    margin: 0 0 18px;
}

.coverage-skill-block h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 500;
}

.coverage-skill-block .coverage-track {
    margin: 0 0 10px;
}

.coverage-pair {
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eeeae3;
}

.coverage-pair p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.coverage-pair .coverage-source {
    color: #5c6b78;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.coverage-empty {
    margin: 0;
    color: #8a93a0;
    font-size: 14px;
}

.coverage-title {
    margin: 0 0 20px;
    padding: 0;
    font-size: 18px;
    font-weight: 500;
    color: #031634;
}

.coverage-note {
    margin: 0;
    color: #8a93a0;
}

.coverage-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coverage-row,
.coverage-scale {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr) 3.25rem;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.coverage-scale[hidden],
.coverage-legend[hidden] {
    display: none;
}

.coverage-skill {
    min-width: 0;
    font-size: 14px;
    color: #031634;
    overflow-wrap: anywhere;
}

.coverage-track {
    display: block;
    min-width: 0;
    width: 100%;
    height: 14px;
    background: #e6e2da;
    overflow: hidden;
}

.coverage-fill {
    display: block;
    height: 100%;
}

.coverage-fill.strong {
    background: #98c848;
}

.coverage-fill.partial {
    background: #f7cc59;
}

.coverage-fill.gap {
    background: #ff0055;
}

.coverage-score {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: #5c6b78;
    text-align: right;
}

.coverage-scale {
    margin-top: 4px;
    font-size: 12px;
    color: #8a93a0;
}

.coverage-scale-track {
    display: flex;
    justify-content: space-between;
}

.coverage-axis {
    margin: 6px 0 0;
    font-size: 13px;
    color: #5c6b78;
}

.coverage-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    font-size: 13px;
    color: #5c6b78;
}

.coverage-legend li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.coverage-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.coverage-swatch.strong {
    background: #98c848;
}

.coverage-swatch.partial {
    background: #f7cc59;
}

.coverage-swatch.gap {
    background: #ff0055;
}

.snap-panel {
    grid-column: 1 / -1;
    min-width: 0;
    overflow-x: hidden;
}

.snap-note,
.val-note {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: #666;
}

.val-note {
    margin: -6px 0 16px;
}

#viz {
    min-width: 0;
    max-width: 100%;
    min-height: 40px;
}

#viz svg.chart {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 800px) {
    .sources,
    .results,
    .skill-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .snap-panel {
        padding-left: 8px;
    }

    .profile-card {
        align-items: flex-start;
    }
}
