:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17212b;
    background: #f4f7f8;
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 10% 0%, #edf7f6 0, transparent 34rem), #f4f7f8; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.topbar { height: 78px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #dbe3e6; background: rgba(255,255,255,.82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #17324d; color: white; font-weight: 800; letter-spacing: .04em; box-shadow: 0 8px 24px rgba(23,50,77,.18); }
.brand strong, .brand small { display: block; }
.brand small { color: #71808c; margin-top: 2px; }
.privacy-pill { border: 1px solid #cfe1de; background: #edf7f5; color: #2b635f; border-radius: 999px; padding: 8px 12px; font-size: .82rem; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.lock-btn { border: 1px solid #cfdadd; background: #fff; color: #53616d; border-radius: 999px; padding: 8px 16px; font-size: .82rem; font-weight: 700; transition: .2s; }
.lock-btn:hover { border-color: #1c7c7a; color: #1c7c7a; }
main { width: min(1500px, 92vw); margin: 0 auto; }
footer { width: min(1500px, 92vw); margin: 70px auto 0; border-top: 1px solid #d7e0e3; padding: 24px 0 42px; color: #71808c; font-size: .9rem; }

.hero { padding: 62px 0 38px; display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 50px; align-items: end; }
.hero h1 { margin: 8px 0 14px; max-width: 900px; color: #17324d; font-size: clamp(2.4rem, 4.8vw, 5.5rem); line-height: .98; letter-spacing: -.055em; }
/* FocusOnNavigate programmatically focuses the page <h1> for accessibility; it is not an interactive control, so suppress the browser focus outline. */
h1:focus { outline: none; }
.hero p { margin: 0; max-width: 800px; color: #53616d; font-size: 1.12rem; line-height: 1.65; }
.eyebrow, .card-kicker { color: #1c7c7a; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; }
.hero-stat { background: #17324d; color: white; border-radius: 24px; padding: 24px; box-shadow: 0 24px 50px rgba(23,50,77,.18); }
.hero-stat span, .hero-stat strong, .hero-stat small { display: block; }
.hero-stat strong { font-size: 1.35rem; margin: 5px 0; }
.hero-stat small { color: #c9d8e4; line-height: 1.5; }
.stat-label { color: #76d1c8; text-transform: uppercase; font-size: .7rem; letter-spacing: .12em; font-weight: 800; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.panel { background: rgba(255,255,255,.92); border: 1px solid #dfe7e9; border-radius: 24px; padding: 26px; box-shadow: 0 14px 40px rgba(29,51,68,.07); }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.panel-heading > div { display: flex; gap: 12px; align-items: center; }
.panel-heading h2 { margin: 0; color: #17324d; font-size: 1.25rem; }
.panel-heading.compact { margin-bottom: 18px; }
.step { padding: 6px 9px; border-radius: 8px; background: #e5f2f1; color: #1c7c7a; font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.muted { color: #81909b; font-size: .82rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 8px; color: #34434f; font-weight: 700; font-size: .9rem; }
label span em { color: #93a0a9; font-weight: 500; font-style: normal; }
input, textarea { width: 100%; border: 1px solid #cfdadd; border-radius: 13px; background: #fbfcfd; color: #17212b; padding: 13px 14px; outline: none; transition: .2s; }
input:focus, textarea:focus { border-color: #1c7c7a; box-shadow: 0 0 0 4px rgba(28,124,122,.10); background: white; }
.description-field { margin-top: 18px; }
.description-field textarea { min-height: 330px; resize: vertical; line-height: 1.55; }
.description-field small { justify-self: end; color: #8996a0; font-weight: 500; }
.actions, .results-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.primary, .secondary { border-radius: 12px; border: 1px solid transparent; padding: 11px 15px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.primary { background: #17324d; color: white; box-shadow: 0 8px 20px rgba(23,50,77,.16); }
.primary:hover { background: #214766; }
.secondary { background: white; color: #34434f; border-color: #cfdbde; }
.secondary:hover { background: #f5f8f9; }
button:disabled { opacity: .65; cursor: wait; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.validation-message, .validation-errors { color: #a33c3c; }
.error-box { margin-top: 16px; border: 1px solid #efcaca; background: #fff1f1; color: #7f3030; border-radius: 12px; padding: 13px; }

.person-card { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid #e4eaec; }
.avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: #17324d; color: white; font-weight: 900; }
.person-card strong, .person-card span { display: block; }
.person-card span { color: #71808c; font-size: .84rem; margin-top: 3px; }
.source-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 18px 0; }
.source-facts div { background: #f5f8f9; border-radius: 12px; padding: 12px 8px; text-align: center; }
.source-facts strong, .source-facts span { display: block; }
.source-facts strong { color: #17324d; font-size: 1.25rem; }
.source-facts span { color: #75838e; font-size: .68rem; line-height: 1.25; }
.guardrail { color: #5f6d78; line-height: 1.6; font-size: .87rem; margin: 0; }

.results { margin-top: 34px; }
.results-header { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin: 0 0 18px; }
.results-header h2 { margin: 5px 0 0; color: #17324d; font-size: 2rem; }
.results-header p { margin: 4px 0 0; color: #71808c; }
.analysis-grid { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 18px; }
.score-card, .analysis-card, .cover-letter, .checklist { border: 1px solid #dfe7e9; background: white; border-radius: 20px; padding: 20px; }
.score-card { display: flex; align-items: center; gap: 18px; }
.score-card p, .analysis-card p { color: #65737e; line-height: 1.45; margin: 5px 0 0; font-size: .87rem; }
.score-ring { --score: 60; width: 88px; height: 88px; flex: 0 0 88px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: conic-gradient(#1c7c7a calc(var(--score) * 1%), #e8eeee 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 8px; background: white; border-radius: 50%; }
.score-ring span, .score-ring small { position: relative; z-index: 1; }
.score-ring span { color: #17324d; font-size: 1.55rem; font-weight: 900; line-height: 1; }
.score-ring small { color: #8b98a1; }
.analysis-card.positive { background: #f3fbfa; border-color: #cfe7e3; }
.analysis-card.warning { background: #fffaf0; border-color: #eadcb8; }
.analysis-card ul { margin: 10px 0 0; padding-left: 18px; color: #6f6041; line-height: 1.45; font-size: .86rem; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chips span { background: white; border: 1px solid #cce0dd; border-radius: 999px; padding: 6px 9px; color: #2a6662; font-size: .78rem; font-weight: 700; }

.document-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; margin-top: 20px; align-items: start; }
.cv-preview { background: white; border: 1px solid #dce4e7; border-radius: 20px; padding: clamp(24px, 4vw, 50px); box-shadow: 0 16px 50px rgba(29,51,68,.07); }
.cv-preview > header { text-align: center; border-bottom: 3px solid #17324d; padding-bottom: 16px; }
.cv-preview > header h3 { margin: 0; color: #17324d; font-size: 2.25rem; letter-spacing: .02em; }
.cv-preview > header strong { display: block; color: #1c7c7a; text-transform: uppercase; font-size: .82rem; letter-spacing: .08em; margin: 5px 0; }
.cv-preview > header span { color: #6f7d88; font-size: .85rem; }
.cv-section h4 { color: #17324d; border-bottom: 2px solid #1c7c7a; padding-bottom: 5px; margin: 22px 0 8px; text-transform: uppercase; font-size: .95rem; }
.cv-section p, .cv-section li { color: #303b44; font-size: .9rem; line-height: 1.52; }
.skill-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 11px; background: #edf5f4; }
.skill-list span { color: #294e4b; font-size: .79rem; font-weight: 700; }
.role-preview { margin-bottom: 15px; }
.role-preview > div { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; }
.role-preview strong { color: #17324d; }
.role-preview span { color: #3f4a53; }
.role-preview em { color: #73808b; font-size: .82rem; }
.role-preview ul { margin: 6px 0 0; padding-left: 18px; }
.application-side { display: grid; gap: 18px; }
.cover-letter p { white-space: pre-line; color: #4f5d68; line-height: 1.55; font-size: .88rem; }
.checklist ol { padding-left: 22px; margin: 13px 0 0; }
.checklist li { padding-left: 5px; margin-bottom: 10px; color: #4f5d68; line-height: 1.45; font-size: .88rem; }
.empty-state { padding: 100px 0; }

@media (max-width: 1050px) {
    .hero { grid-template-columns: 1fr; }
    .hero-stat { max-width: 360px; }
    .workspace, .document-grid { grid-template-columns: 1fr; }
    .source-panel { order: -1; }
    .analysis-grid { grid-template-columns: 1fr 1fr; }
    .score-card { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .topbar { padding: 0 4vw; }
    .privacy-pill { display: none; }
    main { width: 94vw; }
    .hero { padding-top: 40px; }
    .hero h1 { font-size: 2.65rem; }
    .field-grid, .analysis-grid { grid-template-columns: 1fr; }
    .score-card { grid-column: auto; }
    .panel { padding: 19px; border-radius: 18px; }
    .panel-heading, .results-header { align-items: flex-start; flex-direction: column; }
    .muted { display: none; }
    .results-actions { width: 100%; }
    .results-actions button { flex: 1; }
    .role-preview > div { grid-template-columns: 1fr; gap: 2px; }
}
