:root {
    --background: #f2f2ed;
    --surface: #ffffff;
    --ink: #252c34;
    --muted: #59636c;

    --blue: #416681;
    --blue-dark: #2d4c63;
    --blue-light: #e5ecf0;

    --yellow: #ddaf32;
    --yellow-hover: #c99b22;
    --yellow-light: #f5edcf;

    --border: #ccd1d2;
    --error: #a12d37;
    --header-height: 4.5rem;
    --page-gutter: 32px;
    --form-actions-height: 0px;

    /* Compatibility with existing page styles. */
    --purple: var(--blue);
    --purple-dark: var(--blue-dark);
    --purple-light: var(--blue-light);
    --coral: var(--yellow);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-block: calc(var(--topbar-height, var(--header-height)) + 1rem) calc(var(--form-actions-height) + 1rem);
}

body {
    margin: 0;
    padding-bottom: var(--form-actions-height);
    background: var(--background);
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--blue-dark);
    text-underline-offset: 4px;
}

a:hover {
    text-decoration-thickness: 2px;
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 4px;
}

::selection {
    background: var(--yellow);
    color: var(--ink);
}

/* Navigation */

.site-header,
.site-footer {
    width: min(1180px, calc(100% - 64px));
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    min-height: var(--header-height);
    padding-inline: max(32px, calc((100% - 1180px) / 2));
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.site-header form {
    margin: 0;
}

.workspace-page .site-header {
    background: #d8d3cb;
}

.form-actions {
    position: fixed;
    inset: auto 0 0;
    z-index: 4;
    padding-block: .625rem;
    padding-bottom: max(.625rem, env(safe-area-inset-bottom));
    padding-inline: max(var(--page-gutter), calc((100% - 1180px) / 2));
    max-height: 45dvh;
    overflow-y: auto;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.form-actions .full-width {
    max-width: 26rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    background: var(--blue-dark);
    color: var(--yellow);
    font-size: 1.3rem;
}

nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.nav-link:hover {
    text-decoration: underline;
}

.login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 18px;
    border: 1px solid var(--blue);
    border-radius: 4px;
    color: var(--blue-dark);
    font-size: 0.95rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.login-link:hover {
    background: var(--blue-light);
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 52px;
    padding: 14px 24px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: var(--yellow);
    color: var(--ink);
    font-weight: 750;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 150ms ease,
        border-color 150ms ease;
}

.button:hover {
    background: var(--yellow-hover);
    text-decoration: none;
}

.button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.button-small {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.95rem;
}

.full-width {
    width: 100%;
}

/* Typography */

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.12;
}

h1 {
    margin-bottom: 28px;
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    font-weight: 750;
    letter-spacing: -0.055em;
}

h2 {
    letter-spacing: -0.035em;
}

h3 {
    letter-spacing: -0.02em;
}

.accent {
    display: block;
    color: var(--blue);
}

.eyebrow {
    display: block;
    margin-bottom: 20px;
    color: var(--blue-dark);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.lead {
    max-width: 540px;
    margin-bottom: 30px;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.75;
}

.caption,
.field-help {
    color: var(--muted);
    font-size: 0.875rem;
}

.caption {
    margin-top: 20px;
}

.muted {
    color: var(--muted);
}

/* Landing page */

.hero,
.steps-section,
.closing-card {
    width: min(1180px, calc(100% - 64px));
    margin-inline: auto;
}

.hero {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: 80px;
    padding-block: 80px 100px;
}

.hero-content {
    min-width: 0;
}

.hero-content .caption a {
    font-weight: 650;
}

/* Resume illustration */

.resume-scene {
    position: relative;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--blue-light);
}

.resume-scene::before {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 76px;
    height: 6px;
    background: var(--yellow);
    content: "";
}

.resume-sheet {
    padding: 34px;
    border: 1px solid #d7dde1;
    border-radius: 2px;
    background: var(--surface);
    box-shadow: 6px 8px 0 rgb(45 76 99 / 8%);
}

.resume-kicker {
    margin-bottom: 18px;
    color: var(--blue);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.resume-sheet h2 {
    margin-bottom: 6px;
    color: var(--blue-dark);
    font-size: 1.7rem;
}

.resume-sheet p {
    font-size: 0.83rem;
    line-height: 1.7;
}

.resume-role {
    color: var(--muted);
}

.resume-sheet h3 {
    margin-top: 26px;
    margin-bottom: 12px;
    color: var(--blue-dark);
    font-size: 0.88rem;
}

.resume-rule {
    height: 2px;
    margin-block: 22px;
    background: var(--blue);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.skill-list span {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--background);
    color: var(--blue-dark);
    font-size: 0.68rem;
    font-weight: 600;
}

.sample-line {
    height: 6px;
    margin-bottom: 10px;
    background: var(--blue-light);
}

.sample-line.short {
    width: 75%;
}

.resume-tag,
.resume-note {
    position: relative;
    padding: 10px 12px;
    border-radius: 2px;
    font-size: 0.78rem;
    font-weight: 650;
}

.resume-tag {
    margin-bottom: 16px;
    background: var(--yellow-light);
    color: var(--ink);
}

.resume-note {
    margin-top: 16px;
    background: var(--blue-dark);
    color: white;
}

/* How it works */

.steps-section {
    padding-block: 48px 88px;
    border-top: 1px solid var(--border);
}

.steps-section > h2 {
    max-width: 680px;
    margin-bottom: 40px;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.2;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.step-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--blue);
    border-radius: 3px;
    background: var(--surface);
}

.step-number {
    display: block;
    margin-bottom: 30px;
    color: var(--blue);
    font-family: Consolas, monospace;
    font-size: 0.9rem;
    font-weight: 700;
}

.step-card h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.step-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.96rem;
}

/* Final call to action */

.closing-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    margin-bottom: 72px;
    padding: 40px;
    border-left: 5px solid var(--yellow);
    border-radius: 3px;
    background: var(--blue-dark);
    color: white;
}

.closing-card h2 {
    max-width: 680px;
    margin-bottom: 12px;
    font-size: 1.8rem;
    line-height: 1.25;
}

.closing-card p {
    margin-bottom: 0;
    color: #dce5ec;
}

.closing-card .button {
    flex-shrink: 0;
}

/* Registration and login */

.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.auth-footer {
    flex-wrap: wrap;
    margin-top: auto;
}

.auth-footer-note {
    flex-basis: 100%;
    margin: 0;
    padding: 1rem 1.25rem;
    border-inline-start: 5px solid var(--yellow);
    border-radius: 10px;
    background: var(--yellow-light);
    color: var(--ink);
}

.auth-footer-note a {
    font-weight: 750;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 90px;
    width: min(1080px, calc(100% - 64px));
    margin: 64px auto 90px;
}

.auth-intro h1 {
    max-width: 500px;
    font-size: clamp(2.5rem, 4.5vw, 4rem);
}

.intro-note {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--blue-dark);
    font-size: 0.95rem;
    font-weight: 600;
}

.intro-note > span {
    color: var(--blue);
}

.form-card,
.status-card {
    padding: 36px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--yellow);
    border-radius: 4px;
    background: var(--surface);
}

.form-card h2 {
    margin-bottom: 12px;
    font-size: 2rem;
}

.form-card > .muted {
    font-size: 0.95rem;
}

form {
    margin-top: 30px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 650;
}

input:not([type="checkbox"]) {
    width: 100%;
    min-height: 50px;
    margin-bottom: 22px;
    padding: 11px 12px;
    border: 1px solid #929ea7;
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}

input:not([type="checkbox"]):hover {
    border-color: var(--blue);
}

input:not([type="checkbox"]):focus {
    border-color: var(--blue);
}

.field-help {
    margin-top: -14px;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-bottom: 26px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--blue);
}

#cv-review ul {
    padding-inline-start: 0;
    list-style: none;
}

.cv-review .checkbox-label {
    align-items: flex-start;
    margin-bottom: 8px;
}

.cv-review .checkbox-label input {
    flex-shrink: 0;
}

.form-message {
    margin: 20px 0 0;
    padding: 12px 14px;
    border-left: 3px solid var(--error);
    background: #fbf0f0;
    color: var(--error);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.form-message:empty {
    display: none;
}

.form-card .caption {
    margin-bottom: 0;
    line-height: 1.7;
}

/* Email confirmation notice */

.status-layout {
    width: min(620px, calc(100% - 64px));
    margin: 70px auto;
}

.status-card {
    padding: 46px 38px;
    text-align: center;
}

.status-card h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
}

.status-card .lead {
    margin-inline: auto;
}

.status-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 28px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-size: 2rem;
}

.notice {
    margin-block: 26px;
    padding: 18px;
    border-left: 3px solid var(--yellow);
    background: var(--yellow-light);
    color: var(--ink);
    text-align: left;
}

.text-link {
    display: block;
    margin-top: 24px;
    font-size: 0.9rem;
}

/* Workspace and policy pages */

.workspace-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #d8d3cb;
}

.workspace-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: inherit;
}

.workspace-topbar .site-header {
    position: static;
}

.workspace-topbar .workspace-nav {
    width: min(1180px, calc(100% - 2 * var(--page-gutter)));
    margin: 0 auto;
    padding-block: .75rem;
}

.workspace-topbar + .workspace {
    margin-top: .75rem;
}

.workspace {
    width: min(1180px, calc(100% - 64px));
    margin: 40px auto 64px;
    flex: 1;
}

.workspace-welcome {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px 24px;
    margin-bottom: 16px;
    padding: 16px 22px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.workspace-greeting,
.workspace-token-balance {
    margin: 0;
    overflow-wrap: anywhere;
}

.workspace-greeting {
    color: var(--blue-dark);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 700;
}

.workspace-token-balance {
    padding: 4px 12px;
    border-radius: 8px;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-variant-numeric: tabular-nums;
}

.cv-review-form {
    max-width: 42rem;
}

.cv-review-form:not([hidden]) {
    display: grid;
    justify-items: start;
    gap: 16px;
}

.cv-review-form label {
    width: 100%;
}

.cv-review-form select,
.cv-review-form textarea {
    display: block;
    width: 100%;
    min-height: 50px;
    margin-top: 6px;
    padding: 11px 12px;
    border: 1px solid #929ea7;
    border-radius: 8px;
    background: #f7fafc;
    color: var(--ink);
    font: inherit;
}

.cv-review-form textarea {
    resize: vertical;
}

.cv-review-form [role="status"] {
    margin: 0;
}

#create-cv-form {
    max-width: none;
}

#cv-progress {
    width: 100%;
}

.cv-progress-card:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--blue-dark);
    border-radius: 0.5rem;
    background: var(--blue-light);
    color: var(--blue-dark);
}

.cv-progress-card p {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

.cv-progress-spinner {
    flex: 0 0 1.75rem;
    height: 1.75rem;
    border: 3px solid var(--border);
    border-top-color: currentColor;
    border-radius: 50%;
}

@media (prefers-reduced-motion: no-preference) {
    .cv-progress-spinner {
        animation: cv-progress-spin 900ms linear infinite;
    }
}

@keyframes cv-progress-spin {
    to { transform: rotate(360deg); }
}

.cv-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

.cv-field:not([hidden]) {
    display: grid;
    align-content: start;
    gap: 0.25rem;
}

.cv-field textarea {
    margin-top: 0;
}

@media (max-width: 600px) {
    .cv-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

.workspace-nav {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.workspace-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--blue-dark);
    font-weight: 650;
    text-decoration: none;
}

.workspace-nav a:hover {
    background: var(--blue-light);
}

.workspace-nav a[aria-current="page"] {
    border-color: var(--blue-dark);
    background: var(--blue-dark);
    color: white;
    box-shadow: inset 0 -3px var(--yellow);
}

.workspace-panel {
    min-width: 0;
    padding: clamp(22px, 5vw, 54px);
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    overflow-wrap: anywhere;
}

.cv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.cv-actions :is(.button, .login-link) {
    min-height: 3rem;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.cv-dialog {
    max-width: min(28rem, calc(100% - 2rem));
    padding: 1.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
}

.cv-dialog .form-actions {
    position: sticky;
    inset: auto auto -1.5rem;
    margin-top: 1rem;
    padding: .625rem 0;
}

#confirm-cv-dialog .cv-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
}

#confirm-cv-dialog .cv-actions button {
    white-space: normal;
}

@media (max-width: 420px) {
    #confirm-cv-dialog .cv-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cv-dialog::backdrop {
    background: rgb(15 23 42 / 55%);
}

.cv-document {
    --cv-heading-color: #1c4d7e;
    max-width: 210mm;
    margin: 2rem auto 0;
    padding: clamp(1.25rem, 5vw, 3rem);
    border: 1px solid #d6dde8;
    background: #fff;
    color: #172033;
    box-shadow: 0 0.5rem 1.5rem rgb(15 23 42 / 9%);
    overflow-wrap: anywhere;
    font-family: Aptos, Calibri, Arial, sans-serif;
    font-size: 10pt;
    line-height: 1.2;
}

.cv-document header {
    padding-bottom: 0.85rem;
    text-align: center;
}

.cv-document :is(h2, h3, .cv-headline) {
    color: var(--cv-heading-color);
    font-size: inherit;
    font-weight: 700;
    text-transform: uppercase;
}

.cv-document h2 {
    margin: 0;
}

.cv-document :is(h2, .cv-headline) {
    font-size: 14pt;
}

.cv-document .cv-headline {
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.cv-document section {
    margin-top: 0.75rem;
}

.cv-document h3 {
    margin: 0 0 0.3rem;
    padding-bottom: 0.1rem;
    border-bottom: 1px solid #aab5c4;
}

.cv-document :is(p, ul) {
    margin: 0.2rem 0;
}

.cv-document ul {
    padding-inline-start: 1.25rem;
}

.cv-document li {
    margin: 0;
    line-height: 1.12;
}

.cv-document .cv-role-heading {
    margin-top: 0.45rem;
    break-after: avoid;
}

.cv-review {
    max-width: 210mm;
    margin: 0 auto 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.cv-review summary {
    cursor: pointer;
    font-weight: 700;
}

.cv-feedback-icon {
    color: #8a5200;
}

.workspace-panel h1 {
    margin-bottom: 16px;
    font-size: clamp(2.25rem, 5vw, 3.9rem);
}

.workspace-panel > :last-child {
    margin-bottom: 0;
}

.workspace-panel .lead {
    max-width: 62ch;
}

.workspace-panel .cv-intro {
    max-width: none;
}

.cv-fields > .cv-review {
    margin: 0;
    min-width: 0;
}

.cv-workspace.has-result .cv-fields {
    grid-template-columns: minmax(0, 1fr);
}

.cv-workspace #cv-result .cv-document {
    margin-top: 0;
}

.cv-export-actions {
    margin: 0 auto 0.75rem;
    max-width: 210mm;
}

.cv-color-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cv-color-picker input {
    width: 2.5rem;
    min-height: 2rem;
    cursor: pointer;
}

@media print {
    .workspace-page:has(#cv-result:not([hidden])) {
        display: block;
        background: white;
        min-height: 0;

        & > :not(.workspace),
        & .workspace > :not(.workspace-panel),
        & .workspace-panel > :not(.cv-workspace):not(:has(> .cv-workspace)),
        & .workspace-panel > :has(> .cv-workspace) > :not(.cv-workspace),
        & .cv-workspace > :not(#cv-result),
        & #cv-result > :not(.cv-document) {
            display: none;
        }

        & :is(.workspace, .workspace-panel, .cv-workspace.has-result, #cv-result, .cv-document) {
            display: block;
            width: auto;
            max-width: none;
            margin: 0;
            padding: 0;
            border: 0;
            box-shadow: none;
        }

        & .cv-document :is(header, h3) {
            break-after: avoid;
        }
    }
}

.cv-history-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.cv-history-filters input {
    width: 100%;
    min-height: 3rem;
    margin: 0.25rem 0 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.cv-history-filters .cv-actions {
    grid-column: 1 / -1;
}

.cv-history-pagination:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.cv-history-pagination a[hidden] {
    display: none;
}

.cv-review-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.cv-history-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cv-history-list a {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--blue-dark);
    font-weight: 650;
}

.cv-history-list a:is(:hover, [aria-current="true"]) {
    border-color: var(--blue-dark);
    background: var(--blue-light);
}

.cv-history-list time {
    font-size: 0.875rem;
    font-weight: 400;
}

@media (max-width: 899px) {
    .cv-workspace #cv-result {
        margin-top: 1.5rem;
    }

    .cv-history.has-result {
        display: flex;
        flex-direction: column-reverse;
        gap: 1.5rem;
    }

    .cv-history #cv-result {
        margin-top: 0;
    }
}

.cv-comments-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cv-help-button {
    min-width: 1.75rem;
    min-height: 1.75rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: var(--surface);
    color: var(--blue-dark);
    font: inherit;
    cursor: pointer;
}

#cv-comments-help {
    margin: 0;
}

@media (min-width: 900px) {
    .cv-workspace.has-result {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        align-items: start;
        gap: 1.5rem;
    }
}

.profile-page .workspace-panel {
    padding: clamp(24px, 6vw, 72px);
    border-color: #bcb6ad;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgb(37 44 52 / 20%);
}

.profile-page .workspace-panel h1 {
    margin-bottom: 6px;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 18px 32px;
    margin: 0;
}

.profile-details > div {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.profile-details dt {
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 650;
}

.profile-details dd {
    margin: 4px 0 0;
    white-space: pre-wrap;
}

.profile-editor {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

#profile-form {
    min-width: 0;
    margin-top: 0;
}

.profile-layout {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 900px) {
    .profile-layout:has(.profile-timeline:not([hidden])) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 24%);
    }
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
}

#profile-status {
    margin: 0;
}

.profile-timeline {
    min-width: 0;
    padding: .875rem;
    border: 1px solid var(--border);
    border-radius: .625rem;
    background: #f7fafc;
    font-size: .875rem;
}

.profile-timeline h2 {
    margin: 0 0 .75rem;
    font-size: 1rem;
}

.profile-timeline ol {
    margin: 0 0 0 .25rem;
    padding: 0;
    list-style: none;
}

.profile-timeline ol > li {
    position: relative;
    padding: 0 0 .875rem .875rem;
    border-left: 1px solid var(--border);
}

.profile-timeline ol > li:last-child {
    padding-bottom: 0;
    border-color: transparent;
}

.profile-timeline ol > li::before {
    position: absolute;
    top: .45em;
    left: -4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    content: "";
}

.timeline-dates {
    display: block;
    color: var(--muted);
}

.profile-timeline summary {
    width: fit-content;
    margin-top: .2rem;
    color: var(--blue-dark);
    cursor: pointer;
}

.profile-timeline h3 {
    margin: .45rem 0 0;
    font-size: .8rem;
}

.profile-timeline ul {
    margin: 0;
    padding-left: 1.1rem;
}

.profile-intro {
    margin: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid #d8d4ce;
    color: var(--muted);
}

.profile-guidance {
    margin: 0 0 1.25rem;
    padding: .85rem 1rem;
    border-radius: .5rem;
    background: #fff0de;
    color: #61351a;
}

.experience-company .profile-list + .profile-list {
    margin-top: 1.25rem;
}

.experience-current {
    align-self: end;
}

.experience-current input {
    margin-right: .25rem;
}

.profile-editor-legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.profile-editor details {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.profile-editor summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 9px;
    background: var(--blue-light);
    color: var(--blue-dark);
    cursor: pointer;
    list-style: none;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    font-weight: 750;
}

.profile-editor summary::-webkit-details-marker {
    display: none;
}

.profile-editor summary::after {
    content: "";
    flex: 0 0 9px;
    height: 9px;
    margin: 0 3px 4px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.profile-editor summary:hover,
.profile-editor details[open] > summary {
    background: var(--blue-dark);
    color: var(--surface);
}

.profile-editor details[open] > summary {
    border-radius: 9px 9px 0 0;
}

.profile-editor details[open] > summary::after {
    margin-bottom: 0;
    transform: rotate(225deg);
}

.profile-editor .experience-company[open] {
    border-color: #b8ccda;
    background: #eef5fa;
}

.profile-editor .experience-company[open] > summary {
    background: #d5e6f2;
    color: var(--blue-dark);
}

.experience-summary,
.experience-summary-dates:not([hidden]) {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.experience-summary-dates {
    font-size: 0.875rem;
    font-weight: 500;
}

.profile-editor .experience-item {
    margin-bottom: 0.5rem;
    border-radius: 6px;
}

.profile-editor .experience-role {
    border: 1px solid var(--border);
    background: var(--surface);
}

.profile-editor .experience-item > summary {
    padding: 0.55rem 0.8rem;
    border-radius: 5px;
    background: transparent;
    color: var(--blue-dark);
    font-size: 0.95rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.profile-editor .experience-item > summary:hover,
.profile-editor .experience-item[open] > summary {
    background: #eaf2f8;
}

.experience-item > .profile-section,
.experience-company > .profile-section {
    display: flow-root;
}

.experience-item > .profile-section > .profile-remove-icon,
.experience-company > .profile-section > .profile-remove-icon {
    display: block;
    margin-inline-start: auto;
}

.profile-section {
    padding: 16px 18px 18px;
}

.profile-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 12px 18px;
}

.profile-editor input,
.profile-editor textarea,
.profile-editor select {
    display: block;
    margin-top: 6px;
}

.profile-editor input:not([type="checkbox"]) {
    margin-bottom: 0;
}

.profile-editor input:not([type="checkbox"]),
.profile-editor textarea,
.profile-editor select {
    background: #f7fafc;
}

.profile-editor textarea,
.profile-editor select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #929ea7;
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
}

.profile-editor textarea {
    resize: vertical;
}

.profile-editor select {
    min-height: 50px;
}

.profile-list + .profile-list {
    margin-top: 20px;
}

.profile-list h2 {
    margin-bottom: 10px;
    color: var(--blue-dark);
    font-size: 1.15rem;
}

.profile-entry {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.profile-skill-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 16px;
}

.profile-skill-card {
    --skill-accent: #236453;
    --skill-tint: #e3f3ec;
    --skill-border: #b4d9cd;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--skill-border);
    border-radius: 12px;
    background: var(--surface);
}

.profile-skill-card--hard {
    --skill-accent: #274c85;
    --skill-tint: #e7eefb;
    --skill-border: #bdcfee;
}

.profile-skill-card h2 {
    align-self: stretch;
    margin: -16px -16px 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--skill-border);
    border-radius: 11px 11px 0 0;
    background: var(--skill-tint);
    color: var(--skill-accent);
}

.profile-skill-card [data-rows] {
    width: 100%;
}

.profile-editor .profile-skill-card [data-add] {
    margin-top: auto;
    border-color: var(--skill-accent);
    background: var(--skill-tint);
    color: var(--skill-accent);
}

.profile-editor .profile-skill-card [data-add]:hover:not(:disabled) {
    background: var(--skill-accent);
    color: var(--surface);
}

.profile-compact-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px;
    margin-bottom: 8px;
}

.profile-skill-columns .profile-compact-entry {
    max-width: 280px;
}

.profile-skill-columns input[name="name"] {
    min-height: 44px;
    margin-top: 0;
    line-height: 1.2;
}

.profile-editor .profile-highlight-entry textarea {
    margin-top: 0;
}

.profile-remove-icon {
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #a52222;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.profile-remove-icon span {
    font-size: 1.2em;
}

.profile-remove-icon--compact {
    display: inline-grid;
    place-items: center;
    width: 44px;
    padding: 0;
    border-color: currentColor;
    background: transparent;
    color: #a52222;
    font-size: 1.125rem;
}

.profile-remove-icon:hover:not(:disabled) {
    background: #801919;
}

.profile-remove-icon--compact:hover:not(:disabled) {
    background: transparent;
    color: #801919;
}

.profile-entry .profile-remove-icon {
    margin-top: calc(0.9rem * 1.65 + 9px);
}

.profile-editor [data-list="links"] .profile-compact-entry {
    align-items: center;
}

.profile-editor [data-list="links"] .profile-compact-entry :is(input[type="url"], .profile-remove-icon) {
    margin-top: 0;
}

.profile-editor [data-list="links"] .profile-remove-icon {
    align-self: center;
}

.profile-entry--with-inline-remove {
    display: grid;
    align-items: end;
    justify-items: start;
    gap: 8px 12px;
}

.profile-entry--with-inline-remove .profile-fields {
    width: 100%;
}

.profile-entry--with-inline-remove .profile-remove-icon {
    margin-top: 0;
}

@media (min-width: 761px) {
    .profile-entry--with-inline-remove {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .profile-entry--with-inline-remove .profile-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-entry > .profile-remove-icon--compact {
        align-self: start;
        width: 50px;
        min-height: 50px;
        margin-top: calc(0.9rem * 1.65 + 6px);
    }
}

.profile-editor .text-link {
    padding: 4px 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.profile-editor :is([data-add], [data-add-experience]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--blue);
    border-radius: 8px;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-weight: 700;
    text-decoration: none;
}

.profile-editor :is([data-add], [data-add-experience]):hover:not(:disabled) {
    background: var(--blue-dark);
    color: var(--surface);
}

.profile-add-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.profile-editor button:disabled {
    cursor: default;
    opacity: 0.6;
}

.profile-error {
    display: block;
    margin-top: 4px;
    color: #a52222;
}

#profile-status {
    margin-top: 12px;
    font-weight: 650;
}

#profile-status:empty {
    margin: 0;
}

.billing-section {
    margin-bottom: 36px;
}

.contact-address {
    margin-top: 16px;
    color: var(--muted);
}

.legal-page {
    max-width: 800px;
}

.legal-page h2 {
    margin: 28px 0 12px;
}

/* Footer */

.site-footer {
    min-height: 85px;
    padding-block: 24px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--blue-dark);
}

.footer-brand {
    white-space: nowrap;
}

.legal-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 18px;
}

.legal-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
}

/* Tablet */

@media (max-width: 900px) {
    .hero {
        gap: 40px;
    }

    .auth-layout {
        gap: 45px;
    }

    .resume-scene {
        padding: 24px;
    }

    .resume-sheet {
        padding: 26px;
    }

    .step-card {
        padding: 24px;
    }
}

/* Mobile */

@media (max-width: 760px) {
    :root {
        --header-height: 3.875rem;
        --page-gutter: 20px;
    }

    .site-footer,
    .hero,
    .steps-section,
    .closing-card,
    .auth-layout,
    .status-layout,
    .workspace {
        width: calc(100% - 40px);
    }

    .site-header {
        padding-inline: 20px;
    }

    .workspace-topbar .workspace-nav {
        gap: 6px;
        padding-block: .5rem;
    }

    .workspace-topbar .workspace-nav a {
        min-height: 40px;
        padding: 5px 9px;
        font-size: .875rem;
    }

    nav {
        gap: 14px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 45px;
        padding-block: 48px 64px;
    }

    .hero-content .lead {
        max-width: 100%;
    }

    .resume-scene {
        width: 100%;
        max-width: 480px;
        margin-inline: auto;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .steps-section {
        padding-block: 36px 54px;
    }

    .step-number {
        margin-bottom: 20px;
    }

    .closing-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px;
        margin-bottom: 48px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-block: 40px 54px;
    }

    .auth-intro h1 {
        max-width: 100%;
        font-size: 2.7rem;
    }

    .auth-intro .lead {
        max-width: 100%;
        margin-bottom: 0;
    }

    .intro-note {
        margin-top: 24px;
    }

    .status-layout {
        margin-block: 40px;
    }

    .workspace {
        margin-block: 28px 40px;
    }

    .legal-links {
        justify-content: flex-start;
    }
}

@media (max-width: 420px) {
    .site-header:has(nav) {
        flex-wrap: wrap;
        justify-content: center;
        padding-block: 18px;
        gap: 16px;
    }

    .site-header nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }

    #how-it-works {
        scroll-margin-top: 5rem;
    }

    .button-small,
    .login-link {
        padding: 9px 13px;
        font-size: 0.85rem;
    }

    h1 {
        font-size: 2.6rem;
    }

    .form-card,
    .status-card {
        padding: 28px 22px;
    }

    .resume-scene {
        padding: 18px;
    }

    .resume-sheet {
        padding: 22px;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .button {
        transition: none;
    }
}
