:root {
    --primary: #8E1D58;
    --primary-light: #a83471;
    --primary-dark: #6e1545;
    --gold: #C1BC4C;
    --gold-light: #d4cf6a;

    --bg: #fafafa;
    --surface: #ffffff;
    --surface-alt: #f5f3f0;
    --border: #e2ddd8;
    --border-light: #eee9e4;

    --text: #1a1a1a;
    --text-secondary: #5c5650;
    --text-muted: #6b645d;   /* ≥ 4.5:1 on white (was #8c857e, 3.6:1) */
    --text-on-primary: #ffffff;

    --success: #1a8a5c;
    --error: #c0392b;
    --warning: #d4a017;
    --info: #2980b9;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);

    --font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
    --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111110;
        --surface: #1c1b1a;
        --surface-alt: #242320;
        --border: #3a3835;
        --border-light: #2e2d2a;

        --text: #e8e4df;
        --text-secondary: #b0a99f;
        --text-muted: #a39d95;
        --text-on-primary: #ffffff;

        --shadow: 0 1px 3px rgba(0,0,0,0.3);
        --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
    }
}

:root[data-theme="dark"] {
    --bg: #111110;
    --surface: #1c1b1a;
    --surface-alt: #242320;
    --border: #3a3835;
    --border-light: #2e2d2a;

    --text: #e8e4df;
    --text-secondary: #b0a99f;
    --text-muted: #a39d95;
    --text-on-primary: #ffffff;

    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.rtl { direction: rtl; }
.ltr { direction: ltr; }

/* Header */
.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
    color: var(--primary);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-lang {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-lang:hover {
    background: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
}

/* Main */
.app-main {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 24px 16px;
}

/* Footer */
.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px;
    text-align: center;
}

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

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

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

.btn-gold {
    background: var(--gold);
    color: #1a1a1a;
}

.btn-gold:hover {
    background: var(--gold-light);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form elements */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(142, 29, 88, 0.35);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input.is-error,
.form-select.is-error {
    border-color: var(--error);
}

.form-help {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.78rem;
    color: var(--error);
    margin-top: 4px;
}

/* Wizard */
.wizard-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
    padding: 0 16px;
}

.wizard-step {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    transition: background var(--transition);
}

.wizard-step.active {
    background: var(--primary);
}

.wizard-step.done {
    background: var(--gold);
}

.wizard-step-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
}

.wizard-step.active .wizard-step-label {
    color: var(--primary);
    font-weight: 600;
}

.wizard-nav {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 24px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(26, 138, 92, 0.1);
    color: var(--success);
    border: 1px solid rgba(26, 138, 92, 0.2);
}

.alert-error {
    background: rgba(192, 57, 43, 0.1);
    color: var(--error);
    border: 1px solid rgba(192, 57, 43, 0.2);
}

.alert-info {
    background: rgba(41, 128, 185, 0.1);
    color: var(--info);
    border: 1px solid rgba(41, 128, 185, 0.2);
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(142, 29, 88, 0.03);
}

.upload-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.upload-zone-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.upload-zone-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Repeater items (education, experience, etc.) */
.repeater-item {
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.repeater-item .remove-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.rtl .repeater-item .remove-btn {
    left: auto;
    right: 8px;
}

.repeater-item .remove-btn:hover {
    opacity: 1;
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: all var(--transition);
}

.add-btn:hover {
    border-color: var(--primary);
    background: rgba(142, 29, 88, 0.03);
}

/* Row grid */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Profile view */
.profile-section {
    margin-bottom: 24px;
}

.profile-section-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-item-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    min-width: 120px;
}

.profile-item-value {
    font-size: 0.9rem;
    color: var(--text);
    text-align: end;
    flex: 1;
}

/* Landing page */
.landing-hero {
    text-align: center;
    padding: 48px 16px;
}

.landing-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.landing-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

/* Admin */
.admin-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.admin-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--primary);
    color: var(--text-on-primary);
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: var(--bg);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Repeater remove (wizard) */
.repeater-remove {
    position: absolute;
    top: 8px;
    left: 8px;
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 2px 6px;
    opacity: 0.5;
    transition: opacity var(--transition);
}

[dir="rtl"] .repeater-remove,
.rtl .repeater-remove {
    left: auto;
    right: 8px;
}

.repeater-remove:hover {
    opacity: 1;
}

/* Upload zone */
.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(142, 29, 88, 0.05);
}

/* Tags */
.tag {
    display: inline-block;
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.review-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Review step */
.review-section {
    margin-bottom: 24px;
}

.review-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
}

.review-grid {
    display: grid;
    gap: 4px;
}

.review-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.88rem;
}

.review-label {
    color: var(--text-muted);
    min-width: 100px;
}

.review-card {
    background: var(--surface-alt);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.88rem;
}

/* Profile view page */
.profile-view {
    max-width: 680px;
    margin: 0 auto;
}

.profile-header {
    text-align: center;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.profile-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.profile-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
}

.profile-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-view .profile-item {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.profile-view .profile-item:last-child {
    border-bottom: none;
}

.profile-item-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}

.profile-item-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-item-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-item-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.6;
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.82rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ── v2: warning alert, talent-pool consent, confirm progress ── */
.alert-warning {
    background: #fdf6e3;
    color: #7a5b00;
    border: 1px solid #ecd27a;
}
.pool-consent {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    background: #fbf9f6;
}
.pool-consent-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
}
.pool-consent-label input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.pool-consent-label small { display: block; margin-top: 4px; line-height: 1.6; }
.confirm-progress ul { list-style: none; padding: 0; margin: 16px 0 0; }
.confirm-step { padding: 6px 0; font-size: 0.9rem; color: var(--text-muted); }
.confirm-step::before { display: inline-block; width: 1.4em; content: '⏳'; }
.confirm-step.done { color: var(--success); }
.confirm-step.done::before { content: '✓'; }
.confirm-step.failed { color: var(--error); }
.confirm-step.failed::before { content: '✕'; }
.pool-card { border-inline-start: 4px solid var(--border); }
.pool-card.pool-on { border-inline-start-color: var(--success); }
.pool-card-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pool-card-row > div { flex: 1; min-width: 220px; }

/* Admin entered as a candidate (testing / support) */
.admin-as-candidate {
    background: #1a1a2e;
    color: #fff;
    font-size: 0.82rem;
    padding: 8px 16px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.admin-as-candidate a { color: var(--gold); font-weight: 600; }

/* ── v3: consent, privacy page, journey setup, missing fields ── */
.consent-label { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; margin: 4px 0 16px; cursor: pointer; line-height: 1.6; }
.consent-label input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--primary); flex-shrink: 0; }
.consent-label a { color: var(--primary); text-decoration: underline; }
.privacy-page h3 { font-size: 1rem; color: var(--primary); margin: 20px 0 6px; }
.privacy-page p, .privacy-page li { line-height: 1.8; font-size: 0.92rem; }
.privacy-page ul { padding-inline-start: 20px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .choice-grid { grid-template-columns: 1fr; } }
.choice-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; background: #fff; text-align: start; font-family: inherit; transition: border-color .15s, background .15s; }
.choice-card:hover { border-color: var(--primary-light); }
.choice-card.selected { border-color: var(--primary); background: #fdf2f8; }
.choice-card strong { display: block; font-size: 1rem; color: var(--primary); margin-bottom: 4px; }
.choice-card small { color: var(--text-muted); line-height: 1.6; display: block; }
.setup-block + .setup-block { margin-top: 24px; }
.setup-block h3 { font-size: 0.98rem; margin-bottom: 10px; }
.field-missing { border-color: var(--error) !important; background: #fff6f5 !important; }
.field-check { border-color: var(--warning) !important; background: #fffbea !important; }
.section-hint { font-size: 0.82rem; margin-bottom: 12px; }
.wizard-step.has-missing .wizard-step-label::after { content: ' •'; color: var(--error); font-weight: 700; }
.preview-frame { width: 100%; height: 75vh; min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #e8e8ee; }
.tpl-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tpl-picker button { border: 1px solid var(--border); background: #fff; border-radius: 20px; padding: 6px 14px; font-family: inherit; font-size: 0.85rem; cursor: pointer; }
.tpl-picker button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── add-on 1: translation review ── */
.tr-row { border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px; }
.tr-field.tr-changed { border-inline-start: 3px solid var(--warning); padding-inline-start: 8px; background: #fffbea; border-radius: 4px; }
.tr-field + .tr-field { margin-top: 10px; }
.tr-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
@media (max-width: 640px) { .tr-pair { grid-template-columns: 1fr; } }
.tr-source { background: #f6f4f1; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; white-space: normal; }

/* ── add-on 2: improve experience ── */
.improve-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 640px) { .improve-compare { grid-template-columns: 1fr; } }
.improve-changes { margin: 10px 0 0; padding-inline-start: 20px; line-height: 1.7; }
.improve-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.improve-keywords { margin-top: 10px; }
.improve-keywords .review-tags { margin-top: 6px; }

/* Delete-profile card */
.delete-card { border: 1px solid #f1c4bf; }
.delete-card .card-title { color: var(--error); }

/* Admin: upload candidates CVs */
.admin-upload { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; background: #fbf9f6; }
.up-results { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.85rem; }
.up-results li { padding: 4px 0; }
.up-results .up-ok { color: var(--success); }
.up-results .up-fail { color: var(--error); }

/* Skills advice (10+ recommended) */
.skills-advice { font-size: 0.86rem; }
.skills-count { margin-top: 6px; font-weight: 600; color: var(--warning); }
.skills-count.ok { color: var(--success); }

/* Repeater × sits at the END side of the card so it never covers the first field's label */
.repeater-remove { left: auto; right: 8px; }
.rtl .repeater-remove, [dir="rtl"] .repeater-remove { right: auto; left: 8px; }

/* ═══ v3.5.0 — pre-launch fixes ═══ */

/* Keyboard focus is always visible */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, .choice-card:focus-visible, .upload-zone:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.header-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
a.btn-lang { text-decoration: none; display: inline-block; }

/* Landing */
.landing-hero { padding: 32px 8px 24px; }
.landing-badge { display: inline-block; background: #f7f5dc; color: #5f5a14; border: 1px solid var(--gold); border-radius: 20px; padding: 3px 14px; font-size: 0.8rem; font-weight: 600; margin-bottom: 14px; }
.landing-title { font-size: 1.7rem; line-height: 1.4; }
.landing-subtitle { max-width: 560px; line-height: 1.8; margin-bottom: 24px; }
.landing-section { margin: 8px 0 24px; }
.landing-h2 { font-size: 1.15rem; color: var(--primary); margin-bottom: 14px; text-align: center; }
.landing-steps { list-style: none; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.landing-steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; padding-inline-start: 56px; position: relative; }
.landing-steps li::before { content: counter(step); position: absolute; inset-inline-start: 14px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.landing-steps b { display: block; margin-bottom: 2px; }
.landing-steps span { color: var(--text-secondary); font-size: 0.9rem; }
.landing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.landing-feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.landing-feature h3 { font-size: 0.95rem; margin-bottom: 6px; color: var(--primary); }
.landing-feature p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; }
@media (max-width: 680px) { .landing-grid { grid-template-columns: 1fr; } .landing-title { font-size: 1.4rem; } }

.gate-card { max-width: 480px; margin: 0 auto; }

/* Wizard: "Step 3 of 8" + bar on phones, full label row on wider screens */
.wizard-progress { flex-wrap: wrap; }
.wizard-step-count { display: none; width: 100%; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; }
.wizard-step-count b { display: block; height: 6px; background: var(--border); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.wizard-step-count i { display: block; height: 100%; background: var(--primary); width: 0; transition: width var(--transition); }
.wizard-step { cursor: pointer; }
@media (max-width: 640px) {
    .wizard-step-count { display: block; }
    .wizard-step { display: none; }
}

/* Autosave status */
.wizard-nav { align-items: center; }
.save-status { font-size: 0.8rem; color: var(--text-muted); flex: 1; text-align: center; }
.save-status.save-saved { color: var(--success); }
.save-status.save-error { color: var(--error); font-weight: 600; }

/* Session ended */
.session-expired { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.session-expired-card { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); }
.session-expired-card h2 { font-size: 1.1rem; color: var(--primary); margin-bottom: 8px; }
.session-expired-card p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; font-size: 0.92rem; }

/* Admin numbers page (v3.5.1) */
.stats-periods { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.stats-funnel { display: grid; gap: 10px; }
.stats-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) 2fr minmax(110px, auto); gap: 12px; align-items: center; font-size: 0.88rem; }
.stats-bar { height: 14px; background: var(--surface-alt); border-radius: 7px; overflow: hidden; }
.stats-bar i { display: block; height: 100%; background: var(--primary); border-radius: 7px; min-width: 2px; }
.stats-num { white-space: nowrap; }
.stats-num small { display: block; font-size: 0.72rem; }
@media (max-width: 600px) { .stats-row { grid-template-columns: 1fr auto; } .stats-bar { grid-column: 1 / -1; order: 3; } }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stats-tile { background: var(--surface-alt); border-radius: var(--radius-sm); padding: 12px; }
.stats-tile b { display: block; font-size: 1.4rem; color: var(--primary); }
.stats-tile span { font-size: 0.8rem; color: var(--text-secondary); }
.stats-days { display: flex; gap: 4px; align-items: flex-end; height: 140px; }
.stats-day { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.stats-day-bars { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; }
.stats-day-bars i { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.stats-day-bars i.in, .stats-key.in { background: var(--primary); }
.stats-day-bars i.ok, .stats-key.ok { background: var(--gold); }
.stats-day small { font-size: 0.62rem; color: var(--text-muted); margin-top: 4px; }
.stats-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.stats-table th, .stats-table td { padding: 8px; text-align: start; border-bottom: 1px solid var(--border-light); }

/* Landing — public counters (v3.5.1) */
.landing-counters { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-counter { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; text-align: center; min-width: 170px; flex: 1; max-width: 240px; }
.landing-counter b { display: block; font-size: 1.6rem; color: var(--primary); direction: ltr; }
.landing-counter span { font-size: 0.85rem; color: var(--text-secondary); }

/* Phones (v3.5.4): iPhone Safari zooms the whole page in when a field under 16px is
   tapped, and it stays zoomed. 16px on small screens prevents that; also stop iOS
   from inflating text when the phone is turned sideways. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 768px) {
    .form-input, .form-select, .form-textarea, input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], input[type="month"], input[type="number"], select, textarea { font-size: 16px; }
    .btn, .add-btn { min-height: 44px; }
    .wizard-nav { flex-wrap: wrap; }
    .save-status { order: 3; flex-basis: 100%; }
    .preview-frame { height: 70vh; min-height: 420px; }
}
/* Numbers page on phones: 14 day columns must shrink below their date label's width. */
.stats-day { min-width: 0; }
.stats-day small { white-space: nowrap; overflow: hidden; max-width: 100%; }
@media (max-width: 600px) {
    .stats-days { gap: 2px; }
    .stats-day small { font-size: 0.55rem; }
    .stats-day:nth-child(even) small { visibility: hidden; }
}
/* Admin "entered as candidate" bar: a long email breaks cleanly instead of mid-word at random. */
.admin-as-candidate b { word-break: break-all; }
/* Admin CV upload: keep each language choice ("Arabic CVs") on one line. */
.admin-upload label { white-space: nowrap; display: inline-block; }
/* Landing: a service switched off in Settings is shown as "coming soon". */
.landing-soon { display: inline-block; margin-inline-start: 8px; background: #f7f5dc; color: #5f5a14; border: 1px solid var(--gold); border-radius: 20px; padding: 1px 10px; font-size: 0.72rem; font-weight: 600; vertical-align: middle; }
.landing-feature.is-soon p { opacity: 0.75; }
/* Admin profiles: search + job title + status filters (v3.5.5). */
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.admin-filters input[type="search"] { flex: 2 1 220px; }
.admin-filters select { flex: 1 1 160px; min-width: 0; }
/* Footer: feedback contact line on every page. */
.footer-contact { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.footer-contact a { color: var(--primary); }
/* Dialogs built on .session-expired stay hidden until opened. */
.session-expired[hidden] { display: none; }
.delete-share { background: var(--surface-alt); border-radius: var(--radius-sm); padding: 10px; margin: 8px 0; }
/* Admin profiles (v3.5.6): source badges, job-title chips, past-roles checkbox. */
.src-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.src-self { background: #e8f5ee; color: #1a6b47; }
.src-admin { background: #fdf2f8; color: var(--primary); }
.src-invite { background: #eef4fb; color: #1f5f99; }
.job-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 16px; }
.job-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--border); border-radius: 20px; font-size: 0.8rem; color: var(--text-secondary); text-decoration: none; background: var(--surface); }
.job-chip b { color: var(--primary); font-weight: 600; }
.job-chip:hover, .job-chip.active { border-color: var(--primary); color: var(--primary); }
.admin-filter-check { font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; cursor: pointer; }
/* Admin profiles: invitation email state (v3.5.6). */
.mail-state { display: inline-block; font-size: 0.78rem; font-weight: 600; white-space: nowrap; padding: 2px 8px; border-radius: 6px; }
.mail-none { background: var(--surface-alt); color: var(--text-secondary); }
.mail-queued { background: #fff7e0; color: #8a5a00; }
.mail-sent { background: #e8f5ee; color: #1a6b47; }
.mail-failed { background: #fdecea; color: var(--error); }

/* Wizard v3.6.1: section tips, contact hints, "go to section" menu, save button, reminders */
.section-guide { font-size: 0.86rem; line-height: 1.8; color: var(--text-secondary); background: var(--surface-alt); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; }
.field-tip { display: block; font-size: 0.76rem; color: var(--text-muted); margin-top: 4px; line-height: 1.6; }
.field-tip.tip-warn, .field-tip .tip-warn { color: var(--warning, #b45309); font-weight: 600; }
.field-tip a { margin-inline-start: 6px; font-weight: 600; }
.step-jump-wrap { display: none; width: 100%; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); margin-top: 8px; }
.step-jump-wrap select { flex: 1; }
.wizard-nav-mid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.wizard-nav-mid .save-status { flex: 0 1 auto; }
.reminders { border: 1px solid var(--border); border-inline-start: 4px solid var(--gold); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; font-size: 0.88rem; }
.reminders ul { margin: 8px 0; padding-inline-start: 20px; line-height: 1.9; }
.reminders small { color: var(--text-muted); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
@media (max-width: 640px) {
    .step-jump-wrap { display: flex; }
}
@media (max-width: 768px) {
    .wizard-nav-mid { order: 3; flex-basis: 100%; }
}
/* "Show on my CV" tick under a personal field (v3.6.2) */
.show-tick { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-secondary); margin-top: 6px; cursor: pointer; }
.show-tick input { width: 16px; height: 16px; }
