/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d3a;
    --text: #e1e4ed;
    --text-muted: #8b8fa3;
    --accent: #6c63ff;
    --accent-hover: #5a52d5;
    --green: #34d399;
    --yellow: #fbbf24;
    --red: #f87171;
    --warning: #f59e0b;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header — hand-drawn style */
.site-header {
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    font-size: 0.85rem;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}
.site-logo:hover { opacity: 0.8; }
.site-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.2rem 0;
    position: relative;
    transition: color 0.2s;
}
.nav-link:hover {
    color: var(--accent);
}
.nav-link:hover::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    animation: sketchUnderline 0.3s ease-out;
}
@keyframes sketchUnderline {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
.nav-link--muted {
    opacity: 0.6;
}
.nav-link--muted:hover {
    opacity: 1;
}
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}
.brand-text {
    text-align: left;
}
.brand-name {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.brand-name a {
    color: var(--text);
    text-decoration: none;
}
.brand-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}
.header-underline {
    display: block;
    width: 100%;
    height: 6px;
    margin-top: 0.8rem;
    opacity: 0.5;
}

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

/* Form */
.upload-section form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}
.hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}
input[type="file"] {
    padding: 0.8rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
}
textarea, .input-field {
    padding: 0.8rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 4px 6px 5px 3px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
textarea:focus, .input-field:focus, input[type="file"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
button[type="submit"] {
    padding: 0.85rem 2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 5px 7px 6px 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
button[type="submit"]:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
button[type="submit"]:active {
    transform: translateY(0);
}

/* HTMX Loading Indicator */
.htmx-indicator {
    display: none;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}
.htmx-request .htmx-indicator,
.htmx-indicator.htmx-request {
    display: block;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

/* Score Card */
.score-card {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid;
}
.score-good { border-color: var(--green); }
.score-ok { border-color: var(--yellow); }
.score-low { border-color: var(--red); }
.score-number {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}
.score-good .score-number { color: var(--green); }
.score-ok .score-number { color: var(--yellow); }
.score-low .score-number { color: var(--red); }
.score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.keyword-match {
    margin-top: 0.8rem;
    color: var(--text-muted);
}

/* Checklist */
.checklist {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
}
.checklist h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.checklist h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}
.check-list {
    list-style: none;
}
.check-list li {
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.check-icon { font-weight: 700; font-size: 1rem; }
.check-pass .check-icon { color: var(--green); }
.check-fail .check-icon { color: var(--red); }

/* Keyword Tags */
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}
.tag-match {
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.3);
}
.tag-missing {
    background: rgba(248, 113, 113, 0.15);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.3);
}
.tag-more {
    background: var(--border);
    color: var(--text-muted);
}
.tag-remove {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.25);
    font-size: 0.72rem;
}
.tag-improve {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 0.72rem;
}

/* Issues & Recommendations */
.issue-list, .recommendation-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.issue-item {
    padding: 0.5rem 0.8rem;
    background: rgba(248, 113, 113, 0.08);
    border-left: 3px solid var(--red);
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
}
.recommendation-list li {
    padding: 0.5rem 0.8rem;
    background: rgba(251, 191, 36, 0.08);
    border-left: 3px solid var(--yellow);
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
}

/* Generated CV Preview */
.generated-cv {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
}
.generated-cv h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.cv-preview {
    background: white;
    color: #1a1a1a;
    padding: 2rem;
    border-radius: var(--radius);
    line-height: 1.5;
}
.cv-preview h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.cv-preview h2 { font-size: 1.1rem; margin-top: 1.2rem; margin-bottom: 0.5rem; border-bottom: 1px solid #ddd; padding-bottom: 0.3rem; }
.cv-preview h3 { font-size: 0.95rem; margin-top: 0.8rem; }
.cv-preview ul { margin-left: 1.2rem; margin-bottom: 0.5rem; }
.cv-preview li { margin-bottom: 0.2rem; font-size: 0.9rem; }
.cv-preview p { margin-bottom: 0.4rem; font-size: 0.9rem; }

/* Fallback notice */
.fallback-notice {
    padding: 1rem;
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
}
.fallback-notice code {
    background: var(--border);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

/* Error */
.error-card {
    padding: 1.5rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    margin-top: 1rem;
}
.error-card h3 { color: var(--red); margin-bottom: 0.5rem; }

/* Template Picker */
.template-picker {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.template-picker h2 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 0.8rem;
}
@media (max-width: 700px) {
    .template-grid { grid-template-columns: repeat(2, 1fr); }
}
.template-card {
    cursor: pointer;
}
.template-card input[type="radio"] {
    display: none;
}
.template-card-inner {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.template-card input:checked + .template-card-inner {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.template-card:hover .template-card-inner {
    border-color: var(--accent);
}
.template-info {
    margin-top: 0.5rem;
}
.template-info strong {
    font-size: 0.9rem;
}
.template-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.4;
}
.template-best {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--accent);
    margin-top: 0.3rem;
}

/* Template Mini Previews */
.template-preview {
    background: #fff;
    border-radius: 4px;
    padding: 0.6rem;
    height: 80px;
    overflow: hidden;
}
.tpl-mock-header {
    height: 10px;
    border-radius: 2px;
    margin-bottom: 6px;
    width: 50%;
}
.tpl-mock-line {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-bottom: 4px;
}
.tpl-mock-section {
    height: 6px;
    width: 35%;
    border-radius: 2px;
    margin: 8px 0 4px;
}
.w60 { width: 60%; }
.w70 { width: 70%; }
.w80 { width: 80%; }
.w85 { width: 85%; }
.w90 { width: 90%; }

/* Template-specific preview colors */
.template-preview-classic .tpl-mock-header { background: #2c3e50; }
.template-preview-classic .tpl-mock-section { background: #2c3e50; }
.template-preview-modern .tpl-mock-header { background: #1a73e8; }
.template-preview-modern .tpl-mock-section { background: #1a73e8; }
.template-preview-minimal .tpl-mock-header { background: #222; }
.template-preview-minimal .tpl-mock-section { background: #222; }
.template-preview-executive .tpl-mock-header { background: #1b2a4a; width: 100%; height: 16px; }
.template-preview-executive .tpl-mock-section { background: #1b2a4a; }
.template-preview-tech .tpl-mock-header { background: #0ea5e9; border-left: 3px solid #0c4a6e; }
.template-preview-tech .tpl-mock-section { background: #0c4a6e; }
.template-preview-compact .tpl-mock-header { background: #333; }
.template-preview-compact .tpl-mock-section { background: #f0f0f0; border: 1px solid #ddd; }

/* Region Selector */
.region-selector {
    margin-top: 1.2rem;
}
.region-selector label {
    font-size: 0.95rem;
}
.region-options {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}
.region-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.region-option:has(input:checked) {
    border-color: var(--accent);
}
.region-option input[type="radio"] {
    accent-color: var(--accent);
}

/* Region Notes in Results */
.region-notes {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.2rem;
}
.region-notes h2 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}
.region-notes ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.region-notes li {
    font-size: 0.88rem;
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
}
.region-notes li::before {
    content: "i";
    position: absolute;
    left: 0;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(108, 99, 255, 0.15);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    top: 0.35rem;
}

/* Demo Pages */
.demo-section {
    max-width: 1000px;
    margin: 0 auto;
}
.demo-section h2 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* Country Grid */
.country-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin: 1.2rem 0 2.5rem;
}
@media (max-width: 750px) {
    .country-grid { grid-template-columns: repeat(2, 1fr); }
}
.country-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.1s;
}
.country-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.country-flag { font-size: 1.8rem; line-height: 1; }
.country-info { display: flex; flex-direction: column; gap: 0.2rem; }
.country-info strong { font-size: 0.95rem; }
.country-meta { font-size: 0.78rem; color: var(--text-muted); }
.country-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.2rem; }
.badge {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 500;
}
.badge-required { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.badge-common { background: rgba(251, 191, 36, 0.15); color: var(--yellow); }
.badge-no { background: rgba(52, 211, 153, 0.15); color: var(--green); }

/* Template overview cards (demo index) */
.template-overview { margin-top: 1rem; }
.template-overview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem;
}
.template-overview-card strong { font-size: 0.9rem; display: block; margin-top: 0.4rem; }

/* Country detail page */
.country-header { margin-bottom: 1.5rem; }
.country-details { margin-top: 1rem; }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
@media (max-width: 600px) {
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
}
.detail-item {
    background: var(--surface);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.detail-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.15rem;
}
.detail-value { font-size: 0.9rem; font-weight: 600; }

/* Conventions card */
.conventions-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin: 1.5rem 0;
}
.conventions-card h3 { font-size: 1rem; margin-bottom: 0.6rem; }
.conventions-card ul { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.conventions-card li {
    font-size: 0.88rem;
    padding: 0.25rem 0 0.25rem 1.2rem;
    position: relative;
}
.conventions-card li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
}
.field-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}
.field-flag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
}
.flag-yes { background: rgba(251, 191, 36, 0.15); color: var(--yellow); }
.flag-no { background: rgba(139, 143, 163, 0.1); color: var(--text-muted); }

/* Demo template grid */
.section-heading { font-size: 1.1rem; margin: 1.5rem 0 0.8rem; }
.demo-template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}
@media (max-width: 700px) {
    .demo-template-grid { grid-template-columns: repeat(2, 1fr); }
}
.demo-template-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s;
}
.demo-template-card:hover { border-color: var(--accent); }
.demo-template-card strong { font-size: 0.9rem; margin-top: 0.3rem; }
.view-demo {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.2rem;
}

/* Sources */
.sources-card {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.sources-card h3 { font-size: 0.9rem; margin-bottom: 0.5rem; }
.sources-card ul { list-style: none; }
.sources-card li { padding: 0.2rem 0; font-size: 0.85rem; }
.sources-card a { color: var(--accent); text-decoration: none; }
.sources-card a:hover { text-decoration: underline; }

/* Preview page */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--accent); }

.demo-cv-frame {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 1.5rem;
}
.cv-iframe {
    width: 100%;
    height: 900px;
    border: none;
    border-radius: 4px;
    background: white;
}

.preview-notes {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.preview-notes h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}
.preview-notes h3:first-child { margin-top: 0; }
.preview-notes ul { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.preview-notes li { font-size: 0.85rem; padding-left: 1rem; position: relative; }
.preview-notes li::before { content: "·"; position: absolute; left: 0; font-weight: 700; }

.included-list li::before { content: ""; }
.inc-yes::before { content: "✓" !important; color: var(--green); }
.inc-no::before { content: "✗" !important; color: var(--text-muted); }
.inc-no { color: var(--text-muted); }

.source-list a { color: var(--accent); text-decoration: none; }
.source-list a:hover { text-decoration: underline; }

/* Region selector wrap for many countries */
.region-options {
    flex-wrap: wrap;
}

/* Nav link to demo */
.site-header a { color: var(--accent); text-decoration: none; }
header a:hover { text-decoration: underline; }

/* Photo Upload */
.photo-section {
    display: none;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.photo-drop-zone {
    padding: 1.2rem;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
}
.photo-drop-zone:hover { border-color: var(--accent); }
.photo-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.photo-drop-zone p {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.photo-region-info {
    margin-bottom: 0.6rem;
}
.photo-level {
    display: inline-block;
    font-size: 0.82rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
}
.photo-required {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.3);
}
.photo-common {
    background: rgba(251, 191, 36, 0.12);
    color: var(--yellow);
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.photo-optional {
    background: rgba(139, 143, 163, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.photo-uploaded {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.6rem;
    padding: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.photo-thumb {
    width: 64px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.photo-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.photo-status {
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 500;
}
.photo-cloud {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.photo-error {
    padding: 0.6rem 0.8rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    color: var(--red);
    font-size: 0.85rem;
    margin-top: 0.6rem;
}

/* Role Grid (demo index) */
.role-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 0.8rem;
}
@media (max-width: 700px) {
    .role-grid { grid-template-columns: repeat(2, 1fr); }
}
.role-card {
    padding: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.role-card strong { font-size: 0.9rem; }
.role-hero {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--accent);
    margin-top: 0.3rem;
}

/* Matrix Table (country page) */
.matrix-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.matrix-table th {
    text-align: center;
    padding: 0.5rem 0.4rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
.matrix-table td {
    text-align: center;
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid var(--border);
}
.matrix-tpl-name {
    text-align: left !important;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    padding-right: 1rem !important;
}
.matrix-link {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    transition: all 0.15s;
}
.matrix-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.matrix-hero {
    background: rgba(108, 99, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* Role Switcher (preview page) */
.role-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.role-tab {
    padding: 0.4rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    transition: all 0.15s;
}
.role-tab:hover {
    border-color: var(--accent);
    color: var(--text);
}
.role-tab-active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.role-tab-active:hover { color: white; }

/* ============================================
   Multi-Step Wizard
   ============================================ */

/* Progress bar */
/* Wizard progress — hand-drawn style */
.wiz-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}
.wiz-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.3rem;
}
.wiz-node {
    display: block;
}
.wiz-circle--draw {
    animation: drawCircleFull 0.7s ease-out forwards;
}
@keyframes drawCircleFull {
    to { stroke-dashoffset: 0; }
}
.wiz-check {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: drawCheck 0.4s ease-out forwards;
}
.wiz-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.wiz-step--active .wiz-label { color: var(--accent); }
.wiz-step--completed .wiz-label { color: var(--green); }
.wiz-step--upcoming .wiz-label { color: var(--text-muted); opacity: 0.5; }

.wiz-connector {
    flex: 1;
    min-width: 20px;
    max-width: 60px;
    height: 8px;
    margin-bottom: 1.4rem;
}
.wiz-line-svg {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 600px) {
    .wiz-label { display: none; }
    .wiz-connector { min-width: 12px; }
    .wiz-node { width: 30px; height: 30px; }
}

/* Panels — hand-drawn card style */
.wizard-panel {
    display: none;
}
.wizard-panel.active {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    animation: fadeIn 0.3s ease;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 6px 10px 8px 12px;
    padding: 1.8rem 1.5rem;
    position: relative;
}
/* Subtle corner flourish */
.wizard-panel.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 12px;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 2px 2px;
    opacity: 0.5;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    margin-bottom: 0.5rem;
    position: relative;
}
.panel-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: inline-block;
}
.panel-header h2::after {
    content: '';
    display: block;
    height: 2px;
    margin-top: 4px;
    background: var(--accent);
    border-radius: 1px;
    opacity: 0.4;
    animation: sketchGrow 0.5s ease-out;
}
@keyframes sketchGrow {
    from { width: 0; }
    to   { width: 100%; }
}
.panel-header .hint {
    margin-top: 0.4rem;
}

/* Panel actions */
.panel-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}
.panel-actions-center {
    justify-content: center;
    gap: 1rem;
}
.btn-next, .btn-back, .btn-generate {
    padding: 0.7rem 1.8rem;
    border: none;
    border-radius: 5px 7px 6px 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-next {
    background: var(--accent);
    color: white;
}
.btn-next:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.btn-back {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px dashed var(--border);
}
.btn-back:hover {
    border-color: var(--text-muted);
    color: var(--text);
    border-style: solid;
}
.btn-generate {
    background: var(--green);
    color: #0f1117;
    padding: 0.85rem 2.5rem;
    font-size: 1.05rem;
    position: relative;
}
.btn-generate:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.btn-generate:active {
    transform: translateY(0);
}

/* Step 1: Country selector grid */
.country-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
@media (max-width: 700px) {
    .country-select-grid { grid-template-columns: repeat(2, 1fr); }
}
.country-select-card {
    cursor: pointer;
}
.country-select-card input[type="radio"] {
    display: none;
}
.country-select-inner {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 3px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    /* Subtle hand-drawn feel — slightly uneven radius */
    border-radius: 4px 6px 5px 7px;
}
.country-select-card input:checked + .country-select-inner {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
    transform: scale(1.02);
}
.country-select-card:hover .country-select-inner {
    border-color: var(--accent);
    transform: scale(1.01);
}
.country-select-flag {
    font-size: 1.6rem;
    line-height: 1;
}
.country-select-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.country-select-info strong {
    font-size: 0.9rem;
}
.country-select-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Region summary */
.region-summary {
    margin-top: 0.5rem;
}
.region-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}
.region-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.8rem;
    font-weight: 600;
}
.region-summary-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}
.region-summary-fields {
    display: flex;
    gap: 2rem;
}
@media (max-width: 600px) {
    .region-summary-fields { flex-direction: column; gap: 0.8rem; }
}
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.field-group-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.field-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.field-tag {
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}
.field-tag-yes {
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.25);
}
.field-tag-no {
    background: rgba(139, 143, 163, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.field-tag-none {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-style: italic;
}

/* Step 2: Form fields */
.input-field {
    padding: 0.6rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    width: 100%;
}
.input-field:focus {
    outline: none;
    border-color: var(--accent);
}
.input-field::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* References */
.reference-entry {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}
.ref-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
@media (max-width: 600px) {
    .ref-row { flex-direction: column; }
}
.btn-add-ref {
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--accent);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s;
    width: 100%;
}
.btn-add-ref:hover {
    border-color: var(--accent);
}
.btn-remove-ref {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.btn-remove-ref:hover { opacity: 1; }

/* Form section divider */
.form-section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}
.form-section-divider::before,
.form-section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.form-section-divider span {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    white-space: nowrap;
}

/* Required / optional labels */
.required {
    color: var(--red);
    font-weight: 400;
}
.optional-label {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85em;
}

/* Step 3: Extra docs list */
.extra-docs-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.3rem;
}
.extra-doc-item {
    font-size: 0.85rem;
    color: var(--green);
    padding: 0.3rem 0.6rem;
    background: rgba(52, 211, 153, 0.08);
    border-radius: 4px;
}

/* Step 5: Review summary */
.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}
@media (max-width: 600px) {
    .review-grid { grid-template-columns: 1fr; }
}
.review-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
}
.review-item-wide {
    grid-column: 1 / -1;
}
.review-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.review-value {
    font-size: 0.95rem;
    font-weight: 600;
}
.review-preview {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.5;
}

/* Template recommended badge */
.template-recommended .template-card-inner {
    position: relative;
}
.template-rec-badge {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent);
    z-index: 1;
}

/* Region summary notes */
.region-summary-notes {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}
.region-summary-notes ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.region-summary-notes li {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding-left: 1rem;
    position: relative;
}
.region-summary-notes li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.75rem;
}

/* Info card (no conditional fields) */
.info-card {
    padding: 1rem 1.2rem;
    background: rgba(108, 99, 255, 0.06);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text);
}

/* AI recommendation card */
.ai-recommendation {
    padding: 0.8rem 1.2rem;
    background: rgba(108, 99, 255, 0.06);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.ai-rec-label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.ai-recommendation p {
    color: var(--text);
    line-height: 1.5;
    margin-top: 0.3rem;
}

/* Stored file indicator */
.stored-file {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius);
    margin-bottom: 0.4rem;
}
.stored-file-icon {
    font-size: 1.2rem;
}
.stored-file-name {
    font-weight: 600;
    font-size: 0.9rem;
}
.stored-file-status {
    font-size: 0.78rem;
    color: var(--green);
    margin-left: auto;
}

/* Review note */
.review-note {
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Generate button states */
.btn-generating {
    background: var(--surface) !important;
    color: var(--text-muted) !important;
    cursor: wait !important;
    position: relative;
}
.btn-generating::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Generation success banner */
.generate-success {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.2rem;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: var(--radius);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}
.generate-success-icon {
    font-size: 1.1rem;
    color: var(--green);
    font-weight: 700;
}

/* AI loading hint (shown during long requests) */
.ai-loading-hint {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 1rem;
    background: rgba(108, 99, 255, 0.04);
    border: 1px solid rgba(108, 99, 255, 0.15);
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
}
.ai-loading-hint p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.ai-loading-hint .spinner {
    border-top-color: var(--accent);
}

/* CV Quality Review */
.quality-review {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border));
    border-radius: 12px 6px 10px 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.quality-review-header {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.quality-review-header h2 {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
    color: var(--warning);
}
.quality-review-header .hint { margin: 0; }
.quality-review-icon { flex-shrink: 0; margin-top: 0.15rem; }
.quality-flags {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.quality-flag {
    background: color-mix(in srgb, var(--bg) 60%, transparent);
    border: 1px dashed var(--border);
    border-radius: 8px 5px 7px 6px;
    padding: 0.9rem 1rem;
}
.quality-flag--remove {
    border-color: color-mix(in srgb, var(--red) 40%, var(--border));
}
.quality-flag--improve {
    border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
}
.quality-flag-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.quality-flag-severity {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}
.quality-severity-remove {
    background: color-mix(in srgb, var(--red) 20%, transparent);
    color: var(--red);
}
.quality-severity-improve {
    background: color-mix(in srgb, var(--warning) 20%, transparent);
    color: var(--warning);
}
.quality-flag-item {
    font-style: italic;
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}
.quality-flag-reason {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}
/* Selectable flag (label wrapping checkbox) */
.quality-flag-top {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    cursor: pointer;
}
.quality-flag:has(.quality-flag-check:not(:checked)) {
    opacity: 0.45;
    border-style: dotted;
}
.quality-flag:has(.quality-flag-check:not(:checked)) .quality-flag-instruction {
    display: none;
}
.quality-flag-check {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-top: 0.15rem;
    cursor: pointer;
    position: relative;
    background: transparent;
    transition: border-color 0.15s, background 0.15s;
}
.quality-flag-check:checked {
    border-color: var(--warning);
    background: color-mix(in srgb, var(--warning) 15%, transparent);
}
.quality-flag-check:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 6px; height: 10px;
    border: solid var(--warning);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.quality-flag-body { flex: 1; }
.quality-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}
.btn-apply-fixes {
    background: var(--warning);
    color: #1a1a1a;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 8px 5px 7px 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-apply-fixes:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.3);
}
.quality-actions-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}
.quality-flag-section {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}
.quality-flag-suggestion {
    font-size: 0.82rem;
    color: var(--green);
    margin-top: 0.3rem;
    padding-left: 0.6rem;
    border-left: 2px solid color-mix(in srgb, var(--green) 30%, transparent);
    line-height: 1.4;
}
.quality-flag-instruction {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.45rem 0.7rem;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 6px 4px 5px 4px;
    color: var(--text);
    font-size: 0.82rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
.quality-flag-instruction::placeholder {
    color: var(--text-muted);
    font-style: italic;
}
.quality-flag-instruction:focus {
    outline: none;
    border-color: var(--accent);
    border-style: solid;
}

/* ATS Comparison */
.ats-comparison {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.ats-comparison h2 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}
.ats-comparison > .hint {
    margin-bottom: 1rem;
}
.ats-compare-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}
@media (max-width: 600px) {
    .ats-compare-grid { grid-template-columns: 1fr; }
    .ats-compare-arrow { transform: rotate(90deg); }
}
.ats-compare-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
}
.ats-compare-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.ats-compare-generated {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.03);
}
.score-circle-sm {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
}
.score-circle-sm .score-number {
    font-size: 1.6rem;
    font-weight: 800;
}
.keyword-match-sm {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.ats-compare-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
    margin-top: 0.3rem;
}
.section-check {
    font-size: 0.72rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}
.section-found {
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
}
.section-missing {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
}
.ats-compare-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.arrow-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}
.ats-diff {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}
.ats-diff-up {
    color: var(--green);
}
.ats-diff-down {
    color: var(--red);
}
.ats-keyword-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
@media (max-width: 600px) {
    .ats-keyword-detail { grid-template-columns: 1fr; }
}
.ats-kw-col h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* Download button */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-download:hover {
    background: var(--accent-hover);
}
.download-icon {
    font-size: 1.1rem;
}
.generated-cv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.generated-cv-header h2 {
    margin-bottom: 0;
}

/* Results actions */
.results-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}
.results-actions a {
    text-decoration: none;
}

/* Generate progress — hand-drawn style */
.gen-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1rem 2rem;
}
.gen-progress-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.gen-quill-path {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: drawQuill 1.5s ease-out forwards;
}
@keyframes drawQuill {
    to { stroke-dashoffset: 0; }
}
.gen-progress-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* Timeline */
.gen-timeline {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 10px;
}

/* Each step */
.gen-step {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.4rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.gen-step-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Node (circle + check) */
.gen-step-node {
    flex-shrink: 0;
    position: relative;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}
.gen-step-circle {
    display: block;
}
/* Connecting line between nodes */
.gen-step:not(:last-child) .gen-step-node::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 22px;
    width: 2px;
    height: calc(100% + 8px);
    background: repeating-linear-gradient(
        to bottom,
        var(--border) 0px,
        var(--border) 3px,
        transparent 3px,
        transparent 6px
    );
    opacity: 0.5;
}
.gen-step-done .gen-step-node::after {
    background: repeating-linear-gradient(
        to bottom,
        var(--accent) 0px,
        var(--accent) 3px,
        transparent 3px,
        transparent 6px
    );
    opacity: 0.4;
}

/* Circle draw animation for active step */
.gen-step-visible:not(.gen-step-done) .gen-circle-draw {
    animation: drawCircle 0.6s ease-out forwards;
}
@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

/* Check draw animation for completed step */
.gen-step-done .gen-circle-draw {
    stroke-dashoffset: 0;
    opacity: 0.3;
}
.gen-step-done .gen-check-draw {
    animation: drawCheck 0.35s 0.1s ease-out forwards;
}
@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

/* Text content */
.gen-step-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-bottom: 0.6rem;
}
.gen-step-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.4s;
}
.gen-step-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    transition: opacity 0.4s;
}
.gen-step-done .gen-step-text {
    color: var(--text-muted);
    font-weight: 400;
}
.gen-step-done .gen-step-detail {
    opacity: 0.4;
}

/* Writing pencil line at the bottom */
.gen-progress-footer {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 380px;
}
.gen-pencil-line {
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--accent) 0%,
        var(--accent) 40%,
        transparent 100%
    );
    border-radius: 1px;
    position: relative;
    opacity: 0.4;
    animation: sketchLine 2s ease-in-out infinite;
}
.gen-pencil-dot {
    position: absolute;
    right: 0;
    top: -3px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pencilBob 1.2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent);
}
@keyframes sketchLine {
    0%, 100% { width: 30%; opacity: 0.3; }
    50%      { width: 70%; opacity: 0.5; }
}
@keyframes pencilBob {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50%      { transform: translateY(-2px) scale(1.2); opacity: 0.8; }
}

/* Dev helpers */
.btn-dev-fill {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: #f59e0b;
    color: #000;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.7;
    z-index: 9999;
}
.btn-dev-fill:hover { opacity: 1; }

/* ── Landing Page — Hand-drawn aesthetic ────────────────── */

/* Handwriting font family (loaded from Google Fonts in HTML) */
.handwritten {
    font-family: 'Caveat', cursive;
}

/* Fade-in animation for landing sections */
@keyframes landingFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes subtleFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}
@keyframes doodleDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(3px, -4px) rotate(3deg); }
    50%      { transform: translate(-2px, -7px) rotate(-2deg); }
    75%      { transform: translate(4px, -3px) rotate(2deg); }
}
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(1.5deg); }
    75%      { transform: rotate(-1.5deg); }
}

/* Notebook/paper texture background — subtle grid pattern */
.landing {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(108, 99, 255, 0.03) 39px,
            rgba(108, 99, 255, 0.03) 40px
        );
    background-size: 100% 40px;
}

/* Hero — with floating doodle decorations */
.hero {
    text-align: center;
    padding: 7rem 2rem 5rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    animation: landingFadeUp 0.8s ease-out;
}
.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Floating doodle elements around hero */
.hero-doodle {
    position: absolute;
    pointer-events: none;
    opacity: 0.5;
}
.hero-doodle--star-1 {
    top: 15%;
    left: 5%;
    animation: doodleDrift 6s ease-in-out infinite;
}
.hero-doodle--star-2 {
    top: 20%;
    right: 8%;
    animation: doodleDrift 7s ease-in-out infinite 1s;
}
.hero-doodle--arrow {
    bottom: 25%;
    right: 3%;
    animation: doodleDrift 8s ease-in-out infinite 0.5s;
    opacity: 0.35;
}
.hero-doodle--exclaim {
    top: 30%;
    left: 2%;
    animation: doodleDrift 5s ease-in-out infinite 2s;
    opacity: 0.4;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}
.hero-accent {
    color: transparent;
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 50%, #6c63ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    position: relative;
    display: inline-block;
}
/* Hand-drawn squiggly underline under "and land interviews" */
.sketch-underline {
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 12px;
    display: block;
}
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 580px;
    margin: 0 auto 1rem;
    line-height: 1.7;
}
.hero-tagline {
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 0.5rem;
}
.hero-cta { margin-top: 2rem; }
.hero-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.hero-note strong {
    color: var(--green);
}
.hero-note-alpha {
    display: inline-block;
    font-size: 1.15rem;
    color: var(--yellow);
    margin-right: 0.3rem;
    transform: rotate(-2deg);
}

/* Small arrow doodle inside CTA button */
.btn-arrow-doodle {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.3rem;
    margin-bottom: 1px;
}

/* CTA Buttons — slightly sketchy border-radius */
.btn-cta {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent) 0%, #7c6ef5 100%);
    color: #fff;
    padding: 0.9rem 2.2rem;
    border-radius: 6px 10px 8px 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
    position: relative;
}
.btn-cta:hover {
    background: linear-gradient(135deg, #5a52d5 0%, #6c63ff 100%);
    box-shadow: 0 6px 25px rgba(108, 99, 255, 0.45);
    transform: translateY(-2px) rotate(-0.5deg);
}
.btn-cta:active { transform: translateY(0) rotate(0deg); }
.btn-cta--small { padding: 0.5rem 1.2rem; font-size: 0.85rem; box-shadow: none; }
.btn-cta--full { width: 100%; text-align: center; }
.btn-cta--secondary {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    box-shadow: none;
}
.btn-cta--secondary:hover {
    background: rgba(108, 99, 255, 0.08);
    box-shadow: none;
    transform: translateY(-1px) rotate(0deg);
}
.btn-cta--outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    box-shadow: none;
}
.btn-cta--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: none;
    transform: none;
}
.btn-cta--disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Section titles — with hand-drawn scribble underline */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
    width: 100%;
}
.title-scribble {
    display: block;
    width: 60%;
    max-width: 280px;
    height: 8px;
    margin: 0.3rem auto 0;
}

/* Wavy section dividers */
.section-divider {
    display: block;
    width: 100%;
    height: 20px;
    margin: 0 auto;
    max-width: 1000px;
    padding: 0 2rem;
    opacity: 0.5;
}

/* Sticky note base styles — the hand-drawn card look */
.sticky-note {
    border: none !important;
    border-radius: 2px 4px 6px 3px !important;
    box-shadow:
        2px 3px 8px rgba(0, 0, 0, 0.2),
        inset 0 0 40px rgba(0, 0, 0, 0.03);
    position: relative;
}
/* Slight random rotations for sticky note feel */
.sticky-note--yellow {
    background: rgba(251, 191, 36, 0.08) !important;
    border-left: 3px solid rgba(251, 191, 36, 0.3) !important;
    transform: rotate(-1deg);
}
.sticky-note--pink {
    background: rgba(248, 113, 113, 0.08) !important;
    border-left: 3px solid rgba(248, 113, 113, 0.3) !important;
    transform: rotate(0.8deg);
}
.sticky-note--blue {
    background: rgba(96, 165, 250, 0.08) !important;
    border-left: 3px solid rgba(96, 165, 250, 0.3) !important;
    transform: rotate(0.5deg);
}
.sticky-note--green {
    background: rgba(52, 211, 153, 0.08) !important;
    border-left: 3px solid rgba(52, 211, 153, 0.3) !important;
    transform: rotate(-0.7deg);
}
.sticky-note--lavender {
    background: rgba(167, 139, 250, 0.08) !important;
    border-left: 3px solid rgba(167, 139, 250, 0.3) !important;
    transform: rotate(1.2deg);
}
.sticky-note--peach {
    background: rgba(251, 146, 60, 0.08) !important;
    border-left: 3px solid rgba(251, 146, 60, 0.3) !important;
    transform: rotate(-1.5deg);
}
.sticky-note:hover {
    transform: rotate(0deg) translateY(-4px) !important;
    box-shadow:
        3px 5px 15px rgba(0, 0, 0, 0.25),
        inset 0 0 40px rgba(0, 0, 0, 0.03) !important;
}

/* How it works — numbered steps with hand-drawn circles */
.how-it-works {
    padding: 5rem 2rem;
    max-width: 960px;
    margin: 0 auto;
    animation: landingFadeUp 0.8s ease-out both;
    animation-delay: 0.1s;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
    position: relative;
}
/* Remove old connecting line — we use hand-drawn arrows now */
.steps-grid::before {
    display: none;
}

/* Hand-drawn step number circles */
.step-number-doodle {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 auto 1.25rem;
}
.step-number-doodle svg {
    position: absolute;
    top: 0;
    left: 0;
}
.step-number-doodle span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

/* Hand-drawn connecting arrows between steps */
.step-arrows {
    display: flex;
    justify-content: center;
    gap: 33%;
    margin-top: -1.5rem;
    padding: 0 10%;
    pointer-events: none;
}
.step-arrow {
    opacity: 0.5;
}

.step-card {
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}
.step-card h3 { margin-bottom: 0.6rem; font-size: 1.1rem; font-weight: 600; }
.step-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* Features — sticky note cards with doodle icons */
.features {
    padding: 5rem 2rem;
    max-width: 1040px;
    margin: 0 auto;
    animation: landingFadeUp 0.8s ease-out both;
    animation-delay: 0.2s;
}
.features .section-title {
    margin-bottom: 0.5rem;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

/* Doodle icons on feature cards */
.feature-doodle {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--accent);
    opacity: 0.7;
}

.feature-card {
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.feature-card::before {
    display: none;
}
.feature-card h3 {
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
}
.feature-card p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }

/* Final CTA — with hand-drawn annotation arrow */
.final-cta {
    text-align: center;
    padding: 5rem 2rem;
    max-width: 100%;
    margin: 3rem 0 0;
    background: linear-gradient(180deg, transparent 0%, rgba(108, 99, 255, 0.06) 100%);
    border-top: none;
    animation: landingFadeUp 0.8s ease-out both;
    animation-delay: 0.4s;
    position: relative;
}
.final-cta h2 {
    margin-bottom: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.final-cta p { color: var(--text-muted); margin-bottom: 0.5rem; font-size: 1.1rem; }

/* Hand-drawn annotation with curvy arrow near CTA */
.cta-annotation {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}
.cta-arrow {
    display: inline-block;
    vertical-align: middle;
    opacity: 0.5;
}
.cta-annotation-text {
    display: inline-block;
    font-size: 1.3rem;
    color: var(--yellow);
    transform: rotate(-3deg);
    vertical-align: middle;
    margin-left: 0.25rem;
}

/* ── Auth Pages ─────────────────────────────────────────── */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-card h2 { margin-bottom: 0.25rem; }
.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.auth-errors {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--red);
}
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form .form-field { display: flex; flex-direction: column; gap: 0.3rem; }
.auth-form label { font-size: 0.85rem; font-weight: 500; }
.auth-form input {
    padding: 0.65rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-social {
    display: flex;
    gap: 0.75rem;
}
.btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 0.2s;
}
.btn-social:hover { border-color: var(--text-muted); }
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.auth-footer a { color: var(--accent); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Pricing Page ───────────────────────────────────────── */
.pricing-page {
    padding: 3rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}
.pricing-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}
.pricing-cards {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}
.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}
.pricing-card--featured {
    border-color: var(--accent);
    position: relative;
    transform: scale(1.04) translateY(-6px) rotate(0.5deg);
    box-shadow:
        4px 8px 24px rgba(108, 99, 255, 0.18),
        inset 0 0 40px rgba(0, 0, 0, 0.03);
    z-index: 1;
}
.pricing-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    width: fit-content;
}
.pricing-badge--muted {
    background: var(--border);
    color: var(--text-muted);
}
.pricing-price {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}
.pricing-amount {
    font-size: 2.5rem;
    font-weight: 800;
}
.pricing-period { color: var(--text-muted); font-size: 0.9rem; }
.pricing-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex: 1;
}
.pricing-features li {
    padding-left: 1.2rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.pricing-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
}
.pricing-spots {
    text-align: center;
    padding: 0.75rem;
    background: rgba(108, 99, 255, 0.1);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.spots-count { font-weight: 700; color: var(--accent); }
.pricing-balance {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.pricing-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pricing-faq {
    max-width: 600px;
    margin: 0 auto;
}
.pricing-faq h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}
.faq-item h4 { margin-bottom: 0.4rem; font-size: 0.95rem; }
.faq-item p { color: var(--text-muted); font-size: 0.85rem; }

/* ── Pricing Page — Hand-drawn / crafted aesthetic ─────────── */

/* Notebook ruled-line background for the whole pricing page */
.pricing-page--crafted {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(108, 99, 255, 0.03) 39px,
            rgba(108, 99, 255, 0.03) 40px
        );
    background-size: 100% 40px;
    position: relative;
    overflow: hidden;
}

/* Floating doodle decorations */
.pricing-doodle {
    position: absolute;
    opacity: 0.4;
    pointer-events: none;
    animation: doodleDrift 8s ease-in-out infinite;
}
.pricing-doodle--star-1 {
    top: 3rem;
    right: 8%;
    animation-delay: 0s;
}
.pricing-doodle--star-2 {
    top: 12rem;
    left: 5%;
    animation-delay: 2s;
}
.pricing-doodle--exclaim {
    top: 6rem;
    left: 10%;
    animation-delay: 4s;
}

/* Pricing cards as sticky notes */
.pricing-page--crafted .pricing-card {
    border: none;
    transition: all 0.3s ease;
}
.pricing-page--crafted .pricing-card--featured {
    border: none;
    z-index: 2;
}

/* Sketchy badge for Alpha */
.pricing-badge--sketchy {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    padding: 0.3rem 1rem;
    border-radius: 3px 8px 4px 6px;
    border: 1.5px dashed rgba(255, 255, 255, 0.3);
    letter-spacing: 0;
    text-transform: none;
    transform: rotate(-1deg);
    display: inline-block;
    margin-bottom: 1rem;
    width: fit-content;
}

/* Price annotation — curvy arrow with "seriously." */
.pricing-annotation {
    position: relative;
    display: inline-block;
}
.pricing-annotation--price {
    position: absolute;
    bottom: -1.8rem;
    left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.pricing-annotation--price .annotation-arrow {
    transform: scaleY(-1);
}
.pricing-annotation--price .annotation-text {
    font-size: 1.15rem;
    color: var(--accent);
    opacity: 0.7;
    white-space: nowrap;
    transform: rotate(-2deg);
}

/* Hand-drawn checkmarks in feature lists */
.pricing-features--checks {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex: 1;
}
.pricing-features--checks li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.pricing-features--checks li::before {
    content: none;
}
.hand-check-icon {
    flex-shrink: 0;
}

/* "Credits never expire" star doodle */
.pricing-feature--highlight {
    position: relative;
}
.feature-star-doodle {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.25rem;
    margin-bottom: 1px;
    animation: wiggle 3s ease-in-out infinite;
}

/* Spots remaining — handwritten "going fast!" annotation */
.pricing-annotation--hurry {
    display: inline-block;
    font-size: 1rem;
    color: var(--yellow);
    margin-left: 0.5rem;
    transform: rotate(-2deg);
    animation: wiggle 2.5s ease-in-out infinite;
}

/* Value anchor — crafted version with circle highlight */
.pricing-value-anchor--crafted {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    position: relative;
}
.value-highlight {
    position: relative;
    display: inline-block;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--text);
    font-weight: 600;
}
.value-highlight strong {
    position: relative;
    z-index: 1;
}
.value-circle-doodle {
    position: absolute;
    top: -8px;
    left: -12px;
    width: calc(100% + 24px);
    height: calc(100% + 16px);
    pointer-events: none;
}

/* FAQ as notebook paper */
.pricing-faq--notebook {
    max-width: 620px;
    margin: 2rem auto 0;
    padding: 2rem 2.5rem;
    background: var(--surface);
    border-radius: 3px 6px 4px 8px;
    border: 1px solid var(--border);
    border-left: 3px solid rgba(248, 113, 113, 0.15);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 43px,
            rgba(108, 99, 255, 0.06) 43px,
            rgba(108, 99, 255, 0.06) 44px
        );
    background-size: 100% 44px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}
.pricing-faq--notebook .pricing-faq-heading {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.faq-doodle {
    flex-shrink: 0;
    opacity: 0.5;
}
.faq-doodle--right {
    transform: scaleX(-1);
}
.pricing-faq--notebook .faq-item {
    border-bottom: 1px solid rgba(108, 99, 255, 0.08);
    padding: 1.25rem 0;
}
.pricing-faq--notebook .faq-item:last-child {
    border-bottom: none;
}
.pricing-faq--notebook .faq-item h4 {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
}

/* Wavy divider within pricing page */
.pricing-page--crafted .section-divider {
    display: block;
    width: 100%;
    height: 20px;
    margin: 2.5rem auto;
    max-width: 700px;
    opacity: 0.5;
}

/* Top-up cards — 3 columns */
.pricing-cards--topup {
    grid-template-columns: repeat(3, 1fr);
}

/* Keyword-rich intro paragraph below H1 */
.pricing-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 0.5rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-muted);
}

/* Social proof trust line */
.pricing-social-proof {
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: var(--accent);
    margin: 0.75rem auto 1.5rem;
    opacity: 0.85;
}

/* Section heading above the cards grid */
.pricing-section-heading {
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 auto 0.5rem;
}

/* Comparison/context line below value anchor */
.pricing-comparison {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: -1rem auto 2rem;
    max-width: 480px;
    opacity: 0.75;
}

/* Risk reversal note below CTA */
.pricing-risk-reversal {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.6rem 0 0;
    opacity: 0.7;
}

/* Post-alpha nudge CTA line */
.pricing-postalpha-nudge {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    text-align: center;
    line-height: 1.5;
}
.pricing-postalpha-nudge a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.pricing-postalpha-nudge a:hover {
    opacity: 0.8;
}

/* Internal links within feature lists */
.pricing-feature-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(108, 99, 255, 0.35);
}
.pricing-feature-link:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* FAQ heading — styled to match existing h3 pattern but now an h2 */
.pricing-faq-heading {
    font-family: 'Caveat', cursive;
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* FAQ item h3 — keep visual style identical to previous h4 */
.pricing-faq--notebook .faq-item h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    color: var(--text-primary, var(--text));
}

/* Responsive overrides for crafted pricing */
@media (max-width: 768px) {
    .pricing-doodle { display: none; }
    .pricing-annotation--price { display: none; }
    .pricing-cards--topup { grid-template-columns: 1fr; }
    .pricing-faq--notebook { padding: 1.5rem; }
    .value-highlight { font-size: 1.2rem; }
    .pricing-page--crafted .section-divider { display: none; }
}

/* Nav credits badge */
.nav-credits {
    color: var(--green);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .site-nav { flex-wrap: wrap; gap: 1rem; justify-content: center; }
    .site-nav-links { gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 768px) {
    .hero { padding: 4rem 1.5rem 3rem; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.05rem; }
    .hero-tagline { font-size: 1.25rem; }
    .hero::before { width: 300px; height: 300px; }
    .hero-doodle { display: none; }
    .steps-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .step-arrows { display: none; }
    .features-grid { grid-template-columns: 1fr; }
    .pricing-cards { grid-template-columns: 1fr; }
    .pricing-card--featured { transform: rotate(0deg); box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.2), inset 0 0 40px rgba(0, 0, 0, 0.03); }
    .who-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 1.65rem; }
    .how-it-works,
    .features,
    .who-section,
    .comparison-section { padding: 3rem 1.5rem; }
    .final-cta { padding: 3rem 1.5rem; }
    .final-cta h2 { font-size: 1.65rem; }
    .comparison-table { font-size: 0.85rem; }
    .comparison-table th,
    .comparison-table td { padding: 0.65rem 0.75rem; }
    /* Normalize sticky note rotations on mobile for cleaner stacking */
    .sticky-note--yellow,
    .sticky-note--pink,
    .sticky-note--blue,
    .sticky-note--green,
    .sticky-note--lavender,
    .sticky-note--peach { transform: rotate(0deg); }
    .cta-annotation { display: block; margin-bottom: 1rem; }
    .cta-arrow { width: 50px; height: 40px; }
    .cta-annotation-text { font-size: 1.1rem; }
    .section-divider { display: none; }
}

/* === SEO & Marketing additions === */

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}
.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-nav a:hover {
    color: var(--accent);
}
.footer-copy {
    margin: 0;
}

/* Demo CTA block */
.demo-cta {
    margin-top: 2.5rem;
    padding: 2rem;
    text-align: center;
    background: var(--bg-card, #f9f9f6);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.demo-cta h2 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
}
.demo-cta p {
    margin: 0 0 1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.demo-intro {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary, var(--text-muted));
    max-width: 680px;
    margin-bottom: 1.5rem;
}

/* Pricing value anchor */
.pricing-value-anchor {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Landing: Who section */
.who-section {
    padding: 5rem 2rem;
    max-width: 1040px;
    margin: 0 auto;
    animation: landingFadeUp 0.8s ease-out both;
    animation-delay: 0.25s;
}
.who-section .section-title {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.3;
}
.who-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 960px;
    margin: 2.5rem auto 0;
}
.who-card {
    padding: 2rem 1.75rem;
    border: 1px solid var(--border);
    border-radius: 4px 8px 6px 10px;
    background: var(--surface);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}
/* Left accent bar — sketchy style */
.who-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), #a78bfa);
    opacity: 0.4;
    transition: opacity 0.3s;
}
.who-card:hover {
    border-color: rgba(108, 99, 255, 0.25);
    transform: translateY(-3px) rotate(-0.3deg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}
.who-card:hover::before { opacity: 1; }
/* Handwritten label above card heading */
.who-card-label {
    display: block;
    font-size: 1.1rem;
    color: var(--accent);
    opacity: 0.6;
    margin-bottom: 0.25rem;
}
.who-card h3 {
    margin: 0 0 0.6rem;
    font-size: 1.15rem;
    font-weight: 600;
}
.who-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* Landing: Comparison table — notebook paper style */
.comparison-section {
    padding: 5rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    animation: landingFadeUp 0.8s ease-out both;
    animation-delay: 0.3s;
}
.comparison-table-wrap {
    max-width: 750px;
    margin: 2.5rem auto 0;
    overflow-x: auto;
    border-radius: 3px 6px 4px 8px;
    border: 1px solid var(--border);
    background: var(--surface);
}
/* Notebook paper — ruled lines via background */
.comparison-table-wrap.notebook-paper {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 43px,
            rgba(108, 99, 255, 0.06) 43px,
            rgba(108, 99, 255, 0.06) 44px
        );
    background-size: 100% 44px;
    border-left: 3px solid rgba(248, 113, 113, 0.15);
    position: relative;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.comparison-table th,
.comparison-table td {
    padding: 0.9rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(108, 99, 255, 0.06);
}
.comparison-table tbody tr:last-child td,
.comparison-table tbody tr:last-child th {
    border-bottom: none;
}
.comparison-table thead th {
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.comparison-table thead th.comparison-highlight {
    color: var(--accent);
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    text-transform: none;
    letter-spacing: 0;
}
.comparison-table td:first-child {
    font-weight: 500;
    color: var(--text);
}
.comparison-table tbody td:nth-child(2) {
    color: var(--text-muted);
    font-size: 0.9rem;
}
/* Hand-drawn check and X marks */
.hand-check, .hand-x {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.4rem;
    margin-bottom: 2px;
}
.comparison-highlight {
    background: rgba(108, 99, 255, 0.06);
    font-weight: 500;
    color: var(--text);
}
.comparison-table tbody tr {
    transition: background 0.15s;
}
.comparison-table tbody tr:hover {
    background: rgba(108, 99, 255, 0.03);
}

/* Free template badge & actions */
.preview-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}
.free-badge {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}
.demo-free-note {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.demo-free-note strong {
    color: var(--accent);
}
.demo-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================================
   Repeatable Entry (shared macro component)
   ========================================================= */
.repeatable-entry {
    position: relative;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--border);
}
.repeatable-entry:last-child {
    border-bottom: none;
}
.repeatable-remove {
    position: absolute;
    top: 0.6rem;
    right: 0;
    background: none;
    border: none;
    color: var(--red);
    font-size: 0.78rem;
    cursor: pointer;
    opacity: 0.7;
}
.repeatable-remove:hover {
    opacity: 1;
}
.repeatable-add {
    background: none;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.6rem;
    width: 100%;
    transition: border-color 0.2s, color 0.2s;
}
.repeatable-add:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Form rows — generic flex layout for inline fields */
.form-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}
.form-row .form-group {
    flex: 1;
    min-width: 140px;
}
.form-row .form-group--wide {
    flex: 2;
    min-width: 200px;
}

/* Select fields inherit input-field style */
select.input-field {
    appearance: auto;
}

/* =========================================================
   CV Builder — Redesigned Tabbed Workspace
   ========================================================= */

/* -- Page container -- */
.bld {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* -- Top progress bar -- */
.bld-progress {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin: 0.75rem 0 1.5rem;
    overflow: hidden;
}
.bld-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -- Workspace grid -- */
.bld-workspace {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 860px) {
    .bld-workspace { grid-template-columns: 1fr; }
}

/* ── Form panel ── */
.bld-form {
    display: flex;
    flex-direction: column;
}

/* -- Tabs -- */
.bld-tabs {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
    padding: 4px 4px 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.bld-tabs::-webkit-scrollbar { display: none; }

.bld-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.65rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.3s, background 0.2s;
    white-space: nowrap;
    position: relative;
    border-radius: 6px 6px 0 0;
}
.bld-tab:hover {
    color: var(--text);
    background: rgba(108, 99, 255, 0.05);
}
.bld-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(108, 99, 255, 0.08);
}
.bld-tab-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.bld-tab-label {
    display: inline;
}
.bld-tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}
.bld-tab-dot.filled {
    background: var(--green);
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

@media (max-width: 600px) {
    .bld-tab { padding: 0.55rem 0.4rem; font-size: 0.72rem; }
    .bld-tab-label { display: none; }
    .bld-tab-icon { width: 18px; height: 18px; }
}

/* -- Panels -- */
.bld-panels {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    min-height: 420px;
}

.bld-panels > .bld-panel {
    display: none !important;
    padding: 1.25rem 1.5rem;
}
.bld-panels > .bld-panel.active {
    display: block !important;
    animation: bldFadeIn 0.25s ease;
}
@keyframes bldFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- Section header -- */
.bld-section-head {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.bld-section-head h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.2rem;
}
.bld-section-head p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

/* -- Fields & layout -- */
.bld-fields {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.bld-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}
.bld-row--3 {
    grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 600px) {
    .bld-row, .bld-row--3 { grid-template-columns: 1fr; }
}
.bld-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.bld-field--2x { flex: 2; }
.bld-field--full { grid-column: 1 / -1; }

.bld-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}
.bld-label-sm {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}
.bld-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}
.bld-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* -- Builder input overrides (comprehensive, no color-mix fallback issues) -- */
.bld input[type="text"],
.bld input[type="email"],
.bld input[type="tel"],
.bld input[type="url"],
.bld textarea,
.bld select,
.bld .input-field {
    display: block;
    width: 100%;
    background: #13151e;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.bld select {
    appearance: auto;
    cursor: pointer;
}
.bld textarea {
    resize: vertical;
    min-height: 2.5rem;
}
.bld input::placeholder,
.bld textarea::placeholder,
.bld .input-field::placeholder {
    color: #555869;
}
.bld input:focus,
.bld textarea:focus,
.bld select:focus,
.bld .input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

/* -- Entry cards (experience, education, references) -- */
.bld-card {
    background: #14171f;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.6rem;
    position: relative;
    transition: border-color 0.2s;
}
.bld-card:focus-within {
    border-color: #4a44a8;
}
.bld-card--compact { padding: 0.7rem 0.9rem; }
.bld-card:last-of-type { margin-bottom: 0; }

.bld-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}
.bld-card-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(108, 99, 255, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
}
.bld-card-remove {
    background: none;
    border: none;
    color: var(--red);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    transition: opacity 0.15s, background 0.15s;
    font-family: inherit;
}
.bld-card-remove:hover {
    opacity: 1;
    background: rgba(248, 113, 113, 0.1);
}
.bld-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.7rem;
}
@media (max-width: 600px) {
    .bld-card-grid { grid-template-columns: 1fr; }
    .bld-card-grid .bld-field--full { grid-column: 1; }
}

/* -- Add button -- */
.bld-add {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1.5px dashed var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    margin-top: 0.5rem;
}
.bld-add:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(108, 99, 255, 0.05);
}

/* -- Panel navigation (prev/next) -- */
.bld-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.bld-btn-prev, .bld-btn-next {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.bld-btn-prev {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.bld-btn-prev:hover {
    color: var(--text);
    border-color: var(--text-muted);
    transform: translateX(-2px);
}
.bld-btn-next {
    background: var(--accent);
    color: #fff;
}
.bld-btn-next:hover {
    background: var(--accent-hover);
    transform: translateX(2px);
}
.bld-nav-done {
    font-size: 0.82rem;
    color: var(--green);
    font-weight: 500;
}

/* -- Photo upload zone -- */
.bld-photo-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 0.3rem;
}
.bld-photo-zone:hover {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.03);
}
.bld-photo-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.bld-photo-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Preview panel ── */
.bld-preview {
    min-height: 400px;
}
.bld-preview-sticky {
    position: sticky;
    top: 0.75rem;
}
.bld-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
}
.bld-preview-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
}
.bld-preview-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    transition: background 0.3s;
}
.bld-preview-led.pulse {
    background: var(--yellow);
    animation: ledPulse 0.8s ease infinite;
}
@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.bld-preview-updating {
    display: none;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}
.htmx-request .bld-preview-updating { display: inline-flex; }

.bld-preview-btns {
    display: flex;
    gap: 0.4rem;
}
.bld-btn-save, .bld-btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.8rem;
    border-radius: 5px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}
.bld-btn-save {
    background: var(--accent);
    color: #fff;
    border: none;
}
.bld-btn-save:hover { opacity: 0.85; }
.bld-btn-pdf {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.bld-btn-pdf:hover { border-color: var(--accent); }
.bld-btn-pdf[hidden] { display: none; }

/* -- Paper preview -- */
.bld-paper {
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    min-height: 500px;
    max-height: 82vh;
    overflow-y: auto;
    padding: 0;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        0 1px 3px rgba(0, 0, 0, 0.15);
}
.bld-paper #builder-preview {
    padding: 0;
}
.bld-paper .cv-preview {
    color: #1a1a1a;
}

/* -- Empty state -- */
.bld-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}
.bld-empty p {
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
}
.bld-empty span {
    font-size: 0.82rem;
    color: #999;
}

/* ── Modal ── */
.bld-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
}
.bld-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 160;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    width: min(420px, 92vw);
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.bld-modal h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.bld-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.bld-modal-foot {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}
.bld-btn-cancel {
    padding: 0.45rem 1rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
}
.bld-btn-cancel:hover { border-color: var(--text-muted); }

/* ── Toast ── */
.bld-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    color: var(--text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}
.bld-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Save result (reused from old code) ── */
.save-success {
    font-size: 0.82rem;
    color: var(--green);
    padding: 0.3rem 0;
}
.save-success .save-date {
    color: var(--text-muted);
    margin-left: 0.3rem;
}
.save-error {
    font-size: 0.82rem;
    color: var(--red);
    padding: 0.3rem 0;
}

/* ── Preview meta (inside preview partial) ── */
.builder-preview-result .builder-preview-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: #888;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}
.builder-save-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.6rem 1rem;
    background: #f5f5ff;
    border-bottom: 1px solid #e8e8f0;
}
.builder-save-fields {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 160px;
}
.builder-save-fields .input-field {
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}
.btn-save-cv {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
    align-self: flex-end;
}
.btn-save-cv:hover { opacity: 0.85; }
.btn-save-cv:disabled { opacity: 0.5; cursor: not-allowed; }
.builder-preview-result .cv-preview {
    padding: 1rem;
}

/* ── My CVs page ── */
.my-cvs-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.my-cvs-header {
    margin-bottom: 1.5rem;
}
.my-cvs-header h2 {
    margin: 0 0 0.3rem;
}
.my-cvs-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.cv-card {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    background: var(--surface);
    transition: border-color 0.15s;
}
.cv-card:hover {
    border-color: var(--accent);
}
.cv-card-header {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.cv-card-label {
    font-size: 1.05rem;
    margin: 0;
}
.cv-card-job {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.cv-card-meta {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}
.cv-card-source {
    background: var(--accent);
    color: var(--bg);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cv-card-actions {
    display: flex;
    gap: 0.6rem;
}
.cv-card-actions .btn-primary,
.cv-card-actions .btn-secondary {
    font-size: 0.82rem;
    padding: 0.4rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
}
.cv-card-actions .btn-primary {
    background: var(--accent);
    color: var(--bg);
    border: 1.5px solid var(--accent);
}
.cv-card-actions .btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.cv-card-actions .btn-secondary:hover {
    border-color: var(--accent);
}
.my-cvs-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.my-cvs-empty-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 1.2rem;
}
.my-cvs-empty-actions a {
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.my-cvs-empty-actions .btn-primary {
    background: var(--accent);
    color: var(--bg);
}
.my-cvs-empty-actions .btn-secondary {
    border: 1.5px solid var(--border);
    color: var(--text);
}

/* App navigation (authenticated pages only) */
.app-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.app-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.app-nav-link:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--border) 40%, transparent);
}
.app-nav-link--active {
    color: var(--accent);
    font-weight: 600;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.app-nav-credits {
    margin-left: auto;
    color: var(--green, #22c55e);
    font-weight: 600;
    font-size: 0.85rem;
}
@media (max-width: 768px) {
    .app-nav {
        padding: 0.5rem 1rem;
        gap: 0.15rem;
        overflow-x: auto;
        white-space: nowrap;
    }
    .app-nav-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ── Builder edit mode banner ── */
.bld-editing-banner {
    padding: 0.5rem 1rem;
    background: var(--surface-alt, #1e2235);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
}
.bld-editing-banner strong { color: var(--text); }
.bld-editing-new {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
}
.bld-editing-new:hover { text-decoration: underline; }

/* ── Account page ── */
.account-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.account-header {
    margin-bottom: 2rem;
}

.account-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.account-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.account-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.account-section--danger {
    border-color: color-mix(in srgb, var(--red) 35%, var(--border));
    background: color-mix(in srgb, var(--red) 4%, var(--surface));
}

.account-section--danger h3 {
    color: var(--red);
    border-bottom-color: color-mix(in srgb, var(--red) 25%, var(--border));
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.account-field label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.account-value {
    font-size: 0.95rem;
    color: var(--text);
    padding: 0.45rem 0;
}

.account-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.account-hint a {
    color: var(--accent);
    text-decoration: none;
}

.account-hint a:hover {
    text-decoration: underline;
}

/* Stats row */
.account-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.account-stat {
    flex: 1;
    min-width: 100px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
}

.account-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.account-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Billing table */
.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.account-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.account-table td {
    padding: 0.65rem 0.75rem;
    color: var(--text);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

.account-table tr:last-child td {
    border-bottom: none;
}

/* Status badge */
.account-status {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.account-status--completed {
    background: color-mix(in srgb, var(--green) 15%, transparent);
    color: var(--green);
}

.account-status--pending {
    background: color-mix(in srgb, var(--yellow) 15%, transparent);
    color: var(--yellow);
}

.account-status--failed {
    background: color-mix(in srgb, var(--red) 15%, transparent);
    color: var(--red);
}

/* Passkeys */
.account-passkeys {
    margin-top: 1.25rem;
}

.account-passkeys > label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.6rem;
}

.account-passkey-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
}

/* Change password form separation */
.account-password-form {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Feedback messages */
.account-success {
    font-size: 0.85rem;
    color: var(--green);
    margin-top: 0.6rem;
}

.account-error {
    font-size: 0.85rem;
    color: var(--red);
    margin-top: 0.6rem;
}

/* Button variants */
.btn-danger {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-danger:hover {
    opacity: 0.85;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
}

@media (max-width: 600px) {
    .account-stats {
        gap: 0.6rem;
    }
    .account-stat {
        min-width: 80px;
    }
    .account-stat-value {
        font-size: 1.4rem;
    }
    .account-table th,
    .account-table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* (Old builder UX styles removed — replaced by .bld-* classes above) */
