:root {
    --resume-black: #111827;
    --resume-ink: #273241;
    --resume-muted: #64748b;
    --resume-line: #d8dee8;
    --resume-soft: #f5f7fb;
    --resume-white: #ffffff;
    --resume-accent: #1f6feb;
    --resume-good: #12805c;
    --resume-warn: #b45309;
    --resume-danger: #dc2626;
}

body {
    background: #f6f8fb;
}

.resume-page {
    color: var(--resume-ink);
}

.resume-hero {
    background:
        linear-gradient(135deg, rgba(17, 24, 39, .93), rgba(31, 111, 235, .8)),
        url("https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=1800&q=80") center/cover;
    color: #fff;
    padding: 3rem 0 2.5rem;
}

.resume-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    font-size: .86rem;
    margin-bottom: 2rem;
    color: rgba(255,255,255,.78);
}

.resume-breadcrumb a {
    color: #fff;
    text-decoration: none;
}

.resume-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .55fr);
    gap: 2rem;
    align-items: end;
}

.resume-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .7rem;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: .82rem;
    font-weight: 750;
    margin-bottom: 1rem;
}

.resume-hero h1 {
    max-width: 840px;
    font-size: clamp(2.1rem, 5vw, 4.75rem);
    line-height: 1;
    letter-spacing: 0;
    font-weight: 850;
    margin: 0 0 1rem;
}

.resume-lede {
    max-width: 760px;
    font-size: 1.08rem;
    line-height: 1.72;
    color: rgba(255,255,255,.86);
    margin: 0;
}

.resume-hero-actions,
.resume-toolbar-actions,
.resume-action-line,
.ats-meta {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap;
}

.resume-hero-actions {
    margin-top: 1.5rem;
}

.resume-btn,
.resume-icon-btn,
.resume-add-btn,
.btn-magic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.resume-btn {
    padding: .72rem 1rem;
}

.resume-btn:hover,
.resume-icon-btn:hover,
.resume-add-btn:hover,
.btn-magic:hover {
    transform: translateY(-1px);
}

.resume-btn-primary {
    background: #fff;
    color: #111827;
}

.resume-btn-secondary {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-color: rgba(255,255,255,.28);
}

.resume-btn-dark {
    background: #111827;
    color: #fff;
}

.resume-hero-card,
.resume-toolbar,
.editor-panel,
.resume-ats-panel,
.preview-shell,
.resume-content-grid aside,
.resume-faq-grid details {
    background: #fff;
    border: 1px solid var(--resume-line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.resume-hero-card {
    color: var(--resume-ink);
    padding: 1.25rem;
}

.resume-card-top,
.resume-panel-head,
.preview-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.resume-card-top span,
.resume-panel-head strong {
    color: var(--resume-accent);
    font-weight: 850;
}

.resume-score-bar {
    height: 10px;
    background: #e8edf5;
    border-radius: 999px;
    overflow: hidden;
    margin: .9rem 0 1.1rem;
}

.resume-score-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #12805c, #1f6feb);
    border-radius: inherit;
}

.resume-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}

.resume-hero-stats div {
    background: var(--resume-soft);
    border-radius: 8px;
    padding: .75rem;
}

.resume-hero-stats strong {
    display: block;
    color: var(--resume-black);
}

.resume-hero-stats span {
    display: block;
    font-size: .76rem;
    color: var(--resume-muted);
    margin-top: .2rem;
}

.resume-tool-section {
    padding: 1.25rem 0 3rem;
}

.resume-toolbar {
    position: sticky;
    top: var(--nav-height, 68px);
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1rem;
    margin-bottom: 1rem;
}

.resume-toolbar h2,
.resume-panel-head h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 850;
    color: var(--resume-black);
}

.resume-toolbar p,
.resume-panel-head p {
    margin: .18rem 0 0;
    color: var(--resume-muted);
    font-size: .84rem;
}

.resume-icon-btn {
    width: 42px;
    padding: 0;
    background: #fff;
    color: var(--resume-black);
    border-color: var(--resume-line);
}

.resume-icon-btn.danger {
    color: var(--resume-danger);
}

.resume-builder-layout {
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr);
    gap: 1rem;
    align-items: start;
}

.editor-panel {
    padding: 1rem;
}

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

.resume-settings-grid {
    grid-template-columns: 1.1fr 90px 1.3fr;
    margin-bottom: 1rem;
}

.resume-field label,
.resume-action-line label {
    display: block;
    font-size: .76rem;
    font-weight: 800;
    color: var(--resume-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}

.resume-field input,
.resume-field select,
.resume-field textarea,
.resume-ats-panel textarea,
.accordion-body textarea,
.accordion-body input {
    width: 100%;
    border: 1px solid #cfd7e3;
    border-radius: 8px;
    background: #fff;
    color: var(--resume-ink);
    padding: .68rem .75rem;
    font-size: .94rem;
    outline: none;
}

.resume-field input:focus,
.resume-field select:focus,
.resume-field textarea:focus,
.resume-ats-panel textarea:focus,
.accordion-body textarea:focus,
.accordion-body input:focus {
    border-color: var(--resume-accent);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .14);
}

.resume-ats-panel {
    padding: 1rem;
    margin-bottom: 1rem;
}

.resume-ats-panel textarea {
    margin: .85rem 0;
    resize: vertical;
}

.ats-meta {
    justify-content: space-between;
    color: var(--resume-muted);
    font-size: .84rem;
    margin-bottom: .75rem;
}

.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.keyword-pill {
    border: 1px solid var(--resume-line);
    border-radius: 999px;
    padding: .25rem .55rem;
    font-size: .76rem;
    background: #fff;
    color: var(--resume-muted);
}

.keyword-pill.found {
    color: var(--resume-good);
    background: #eaf8f2;
    border-color: #b8e6d3;
}

.keyword-pill.missing {
    color: var(--resume-warn);
    background: #fff7ed;
    border-color: #fed7aa;
}

.resume-accordion {
    display: grid;
    gap: .75rem;
}

.resume-accordion .accordion-item {
    overflow: hidden;
    border: 1px solid var(--resume-line);
    border-radius: 8px;
    background: #fff;
}

.resume-accordion .accordion-button {
    gap: .6rem;
    font-weight: 850;
    color: var(--resume-black);
    background: #fff;
    box-shadow: none;
}

.resume-accordion .accordion-button:not(.collapsed) {
    background: #f8fbff;
    color: var(--resume-black);
}

.resume-accordion .accordion-body {
    background: #fff;
    border-top: 1px solid var(--resume-line);
}

.resume-action-line {
    justify-content: space-between;
    margin-bottom: .5rem;
}

.btn-magic {
    min-height: 34px;
    padding: .38rem .7rem;
    background: #1f6feb;
    color: #fff;
    border: none;
    font-size: .82rem;
}

.btn-magic:disabled,
.resume-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.dynamic-item {
    position: relative;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: .75rem;
}

.btn-remove-item {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 32px;
    height: 32px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: var(--resume-danger);
    background: #fff;
}

.resume-add-btn {
    width: 100%;
    color: var(--resume-accent);
    background: #f8fbff;
    border-color: #bdd4ff;
    padding: .7rem;
}

.preview-panel {
    position: sticky;
    top: calc(var(--nav-height, 68px) + 74px);
}

.preview-shell {
    padding: 1rem;
    background: #334155;
}

.preview-top {
    color: #fff;
    margin-bottom: .8rem;
}

.preview-top span {
    color: rgba(255,255,255,.72);
    font-size: .84rem;
}

.a4-paper {
    width: min(100%, 210mm);
    min-height: 297mm;
    margin: 0 auto;
    background: #fff;
    padding: 18mm;
    box-shadow: 0 18px 40px rgba(0,0,0,.25);
    color: #1f2937;
    font-family: "Plus Jakarta Sans", Arial, sans-serif;
}

.res-header {
    text-align: center;
    padding-bottom: 1.05rem;
    border-bottom: 2px solid var(--resume-accent);
    margin-bottom: 1.25rem;
}

.res-name {
    margin: 0;
    color: #111827;
    font-size: 26pt;
    line-height: 1.05;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.res-title {
    color: var(--resume-accent);
    font-weight: 750;
    margin-top: .25rem;
    font-size: 12.5pt;
}

.res-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem .8rem;
    margin-top: .65rem;
    color: #4b5563;
    font-size: 9.2pt;
}

.res-section-title {
    font-size: 11.4pt;
    font-weight: 850;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: .035em;
    margin: 1rem 0 .45rem;
}

.res-summary-text,
.res-exp-company,
.res-exp-bullets,
.res-inline-list,
.res-skills-list {
    font-size: 9.3pt;
    line-height: 1.55;
}

.res-summary-text {
    margin: 0;
}

.res-exp-item {
    margin-bottom: .85rem;
    break-inside: avoid;
}

.res-exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.res-exp-title {
    font-weight: 850;
    color: #111827;
    font-size: 10.2pt;
}

.res-exp-date {
    color: var(--resume-accent);
    font-size: 8.8pt;
    font-weight: 750;
    white-space: nowrap;
}

.res-exp-company {
    color: #4b5563;
    font-style: italic;
    margin: .1rem 0 .25rem;
}

.res-exp-bullets {
    margin: 0;
    padding-left: 1.05rem;
}

.res-skills-list,
.res-inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.res-skill-badge,
.res-inline-item {
    display: inline-flex;
    border-radius: 4px;
    padding: .2rem .48rem;
    background: #eef2f7;
    color: #263244;
    font-weight: 650;
}

.template-modern .res-header {
    text-align: left;
    border-left: 7px solid var(--resume-accent);
    border-bottom: 1px solid #d7deea;
    padding-left: 1rem;
}

.template-modern .res-contact {
    justify-content: flex-start;
}

.template-compact {
    padding: 14mm;
}

.template-compact .res-section-title {
    margin-top: .7rem;
}

.template-compact .res-summary-text,
.template-compact .res-exp-company,
.template-compact .res-exp-bullets,
.template-compact .res-inline-list,
.template-compact .res-skills-list {
    font-size: 8.7pt;
    line-height: 1.42;
}

.resume-content-section,
.resume-faq-section {
    padding: 3rem 0;
    background: #fff;
}

.resume-faq-section {
    background: #f6f8fb;
}

.resume-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 2rem;
    align-items: start;
}

.resume-content-grid h2,
.resume-faq-section h2 {
    color: var(--resume-black);
    font-weight: 850;
    letter-spacing: 0;
}

.resume-content-grid h3 {
    margin-top: 1.6rem;
    color: var(--resume-black);
    font-size: 1.2rem;
    font-weight: 800;
}

.resume-content-grid p {
    color: #475569;
    line-height: 1.78;
}

.resume-content-grid aside {
    padding: 1.25rem;
}

.resume-checklist {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: .75rem;
}

.resume-checklist li {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    color: #334155;
}

.resume-checklist i {
    color: var(--resume-good);
}

.resume-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin-top: 1.25rem;
}

.resume-faq-grid details {
    padding: 1rem;
}

.resume-faq-grid summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--resume-black);
}

.resume-faq-grid p {
    margin: .75rem 0 0;
    color: #475569;
    line-height: 1.65;
}

@media (max-width: 1199px) {
    .resume-builder-layout,
    .resume-content-grid {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
    }
}

@media (max-width: 767px) {
    .resume-hero {
        padding-top: 2rem;
    }

    .resume-hero-grid,
    .resume-faq-grid,
    .resume-settings-grid,
    .resume-form-grid {
        grid-template-columns: 1fr;
    }

    .resume-toolbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }

    .resume-toolbar-actions {
        width: 100%;
    }

    .resume-btn-dark {
        flex: 1;
    }

    .editor-panel,
    .preview-shell {
        padding: .75rem;
    }

    .a4-paper {
        padding: 10mm;
        min-height: auto;
    }

    .res-name {
        font-size: 20pt;
    }

    .res-exp-header {
        display: block;
    }
}

@media print {
    header,
    footer,
    .resume-hero,
    .resume-toolbar,
    .editor-panel,
    .preview-top,
    .resume-content-section,
    .resume-faq-section {
        display: none !important;
    }

    body,
    .resume-tool-section,
    .preview-shell,
    .preview-panel {
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }

    .resume-builder-layout {
        display: block;
    }

    .a4-paper {
        width: 210mm;
        min-height: 297mm;
        box-shadow: none;
    }
}
