/* ===== CSS Variables ===== */
:root {
    --bg-primary: #eef4ff;
    --bg-secondary: rgba(255, 255, 255, 0.55);
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.90);
    --border-color: rgba(148, 163, 184, 0.28);
    --border-light: rgba(148, 163, 184, 0.45);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-primary: #2563eb;
    --accent-secondary: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #1d4ed8, #3b82f6);
    --accent-glow: rgba(37, 99, 235, 0.20);
    --accent-soft: rgba(37, 99, 235, 0.08);

    --q-color: #0ea5e9;
    --cv-color: #f59e0b;
    --fused-color: #2563eb;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --glass-blur: blur(20px);
    --glass-border: rgba(255, 255, 255, 0.65);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 4px 16px rgba(37, 99, 235, 0.08), 0 1px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 32px rgba(37, 99, 235, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.12);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #eef4ff 0%, #dbeafe 45%, #ede9fe 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Ambient Background Orbs ===== */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.7;
}

.orb-1 {
    width: 650px;
    height: 650px;
    top: -20%;
    left: -15%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, transparent 70%);
}

.orb-2 {
    width: 550px;
    height: 550px;
    bottom: -20%;
    right: -15%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, transparent 70%);
}

.orb-3 {
    width: 400px;
    height: 400px;
    top: 45%;
    right: 15%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.10) 0%, transparent 70%);
}

/* ===== Layout ===== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.app-main {
    flex: 1;
    padding: 40px 0;
}

/* ===== Header ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin: 16px 0 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.30);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-steps {
    display: flex;
    gap: 6px;
}

.nav-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-step.active {
    background: rgba(37, 99, 235, 0.10);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.nav-step.completed {
    background: rgba(16, 185, 129, 0.10);
    border-color: var(--success);
    color: var(--success);
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.nav-step.active .step-num {
    background: var(--accent-primary);
    color: white;
}

.nav-step.completed .step-num {
    background: var(--success);
    color: white;
}

/* ===== Sections ===== */
.step-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-header.compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ===== Questionnaire ===== */
.questionnaire-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.progress-bar {
    height: 5px;
    background: rgba(148, 163, 184, 0.20);
    border-radius: 3px;
    margin-bottom: 32px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.40);
}

.question-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.question-item {
    display: flex;
    gap: 16px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.60);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.question-item:focus-within {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.question-number {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.question-content {
    flex: 1;
}

.question-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.question-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.question-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
}

.question-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.question-input::placeholder {
    color: var(--text-muted);
}

.input-stats {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== CV Upload ===== */
.cv-upload-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0;
    margin-bottom: 24px;
    transition: var(--transition);
    overflow: hidden;
}

.cv-upload-card.dragover {
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.04);
}

.cv-upload-card.processing {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.04);
}

.cv-upload-card.done {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.04);
    border-style: solid;
}

.upload-zone {
    position: relative;
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover {
    background: rgba(37, 99, 235, 0.03);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.65;
}

.upload-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-status {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 500;
    min-height: 20px;
}

.upload-status .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* ===== CV Input Grid ===== */
.cv-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.cv-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.cv-card:hover {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: var(--shadow-lg);
}

.cv-card.full-width {
    grid-column: 1 / -1;
}

.cv-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cv-icon {
    font-size: 22px;
}

.cv-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.cv-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.80);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
}

.cv-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.info-box {
    display: flex;
    gap: 16px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 32px;
}

.info-icon {
    font-size: 20px;
}

.info-content strong {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-primary);
}

.info-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Validation Hint ===== */
.validation-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    color: #92400e;
    transition: var(--transition);
}

.validation-hint.valid {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.25);
    color: #065f46;
}

.hint-icon {
    font-size: 16px;
}

.hint-text {
    line-height: 1.5;
}

.hint-text .missing-q {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===== Buttons ===== */
.section-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 0;
}

.section-actions.center {
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.30);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.40);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.btn-large {
    padding: 14px 32px;
    font-size: 15px;
}

/* ===== Processing Animation ===== */
.processing-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.processing-animation {
    margin-bottom: 40px;
}

.orbit {
    position: relative;
    width: 140px;
    height: 140px;
}

.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring-1 {
    width: 140px;
    height: 140px;
    border-top-color: var(--accent-primary);
    border-right-color: rgba(37, 99, 235, 0.25);
    animation: spin 3s linear infinite;
}

.ring-2 {
    width: 100px;
    height: 100px;
    border-bottom-color: var(--accent-secondary);
    border-left-color: rgba(59, 130, 246, 0.25);
    animation: spin-reverse 2s linear infinite;
}

.ring-3 {
    width: 60px;
    height: 60px;
    border-top-color: var(--q-color);
    border-bottom-color: rgba(14, 165, 233, 0.25);
    animation: spin 1.5s linear infinite;
}

.orbit-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    box-shadow: 0 0 24px rgba(37, 99, 235, 0.30);
    font-size: 18px;
}

@keyframes spin-reverse {
    to { transform: translate(-50%, -50%) rotate(-360deg); }
}

.processing-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.processing-subtitle {
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.processing-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    min-width: 400px;
}

.proc-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
}

.proc-step.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.07);
}

.proc-step.completed {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.07);
}

.proc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-light);
    flex-shrink: 0;
    transition: var(--transition);
}

.proc-step.active .proc-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.40);
}

.proc-step.completed .proc-dot {
    background: var(--success);
}

/* ===== Results ===== */
.results-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.result-card.wide {
    grid-column: 1 / -1;
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.result-card-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-card-header .subheader {
    font-size: 13px;
    color: var(--text-muted);
}

.legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.q      { background: var(--q-color); }
.dot.cv     { background: var(--cv-color); }
.dot.fused  { background: var(--fused-color); }

.chart-container {
    position: relative;
    height: 320px;
    margin-bottom: 20px;
}

.dimension-weights {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.dim-weight {
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.dim-name {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dim-percent {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* DNA Badge */
.dna-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 24px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.30);
    color: white;
}

.dna-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.90;
}

.dna-score {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

/* Score Breakdown */
.score-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.score-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.score-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.weight-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 4px;
    color: var(--accent-primary);
    font-weight: 500;
}

.score-section.highlight {
    background: rgba(37, 99, 235, 0.05);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.dim-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dim-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dim-bar-label {
    width: 60px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

.dim-bar-track {
    flex: 1;
    height: 7px;
    background: rgba(148, 163, 184, 0.20);
    border-radius: 4px;
    overflow: hidden;
}

.dim-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.dim-bar-fill.q     { background: var(--q-color); }
.dim-bar-fill.cv    { background: var(--cv-color); }
.dim-bar-fill.fused { background: var(--fused-color); }

.dim-bar-value {
    width: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.formula-box {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent-primary);
}

/* Formulas */
.formulas-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.formula-item {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.formula-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.formula-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.formula-content .katex {
    font-size: 1em;
}

/* Role Recommendations */
.role-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.role-item {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.68);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.role-item:hover {
    border-color: rgba(37, 99, 235, 0.30);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.role-rank {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.50);
    color: var(--text-muted);
}

.role-rank.gold   { color: #d97706; background: rgba(251, 191, 36, 0.12); }
.role-rank.silver { color: #64748b; background: rgba(203, 213, 225, 0.15); }
.role-rank.bronze { color: #c2410c; background: rgba(249, 115, 22, 0.10); }

.role-content {
    flex: 1;
    padding: 18px 22px;
}

.role-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.role-category {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.role-metrics {
    display: flex;
    gap: 24px;
}

.role-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
}

.metric-value.high   { color: var(--success); }
.metric-value.medium { color: var(--warning); }
.metric-value.low    { color: var(--danger); }

.metric-hint {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 1px;
}

.role-skills {
    width: 260px;
    padding: 18px 20px;
    background: rgba(37, 99, 235, 0.03);
    border-left: 1px solid var(--border-color);
}

.role-skills h5 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-tag {
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.07);
    border: 1px solid rgba(37, 99, 235, 0.18);
    color: var(--accent-primary);
}

.skill-tag.missing {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

/* Skill Gap */
.skill-gap-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gap-role {
    background: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.gap-role-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.gap-role-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.gap-ease {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
}

.gap-ease.easy   { background: rgba(16, 185, 129, 0.12); color: #065f46; }
.gap-ease.medium { background: rgba(245, 158, 11, 0.12);  color: #92400e; }
.gap-ease.hard   { background: rgba(239, 68, 68, 0.12);   color: #991b1b; }

.gap-skills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gap-skill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.gap-skill-name {
    color: var(--text-secondary);
}

.gap-difficulty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.difficulty-bar {
    width: 60px;
    height: 4px;
    background: rgba(148, 163, 184, 0.25);
    border-radius: 2px;
    overflow: hidden;
}

.difficulty-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent-primary);
}

.difficulty-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 20px;
    text-align: right;
}

.gap-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.gap-summary-label { color: var(--text-muted); }
.gap-summary-value { font-weight: 600; color: var(--text-primary); }

/* ===== Dimension Legend ===== */
.dim-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.dim-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.dim-legend-item:hover {
    background: rgba(255, 255, 255, 0.80);
}

.dim-legend-code {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
    margin-top: 1px;
}

.dim-legend-code.d1 { background: var(--accent-primary); }
.dim-legend-code.d2 { background: #0ea5e9; }
.dim-legend-code.d3 { background: #8b5cf6; }
.dim-legend-code.d4 { background: #10b981; }
.dim-legend-code.d5 { background: #f59e0b; }

.dim-legend-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dim-legend-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.dim-legend-name em {
    font-style: normal;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 5px;
}

.dim-legend-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Footer */
.app-footer {
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Job Matching ===== */
.job-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.job-card {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(12px);
}

.job-card:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.job-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.job-match-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    font-weight: 600;
    flex-shrink: 0;
}

.match-score {
    font-size: 22px;
    line-height: 1;
}

.match-label {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.8;
}

.job-title-section {
    flex: 1;
    min-width: 0;
}

.job-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.job-salary {
    color: #ea580c;
    font-weight: 600;
}

.job-company {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.company-name  { font-weight: 500; color: var(--text-secondary); }
.company-info  { color: var(--text-muted); }

.job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

/* job-skills reuses .skill-tag defined above */

.job-reasons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(37, 99, 235, 0.04);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.reasons-label {
    color: var(--text-muted);
    font-weight: 500;
}

.reason-tag {
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.10);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 11px;
}

.job-welfare {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.welfare-tag {
    padding: 3px 8px;
    background: rgba(245, 158, 11, 0.10);
    color: #92400e;
    border-radius: 4px;
    font-size: 11px;
}

.job-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-apply {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 24px;
    gap: 2px;
}

.btn-apply span  { font-size: 14px; font-weight: 600; }
.btn-apply small { font-size: 11px; opacity: 0.8; font-weight: 400; }

#job-match-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#job-match-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#job-match-actions .btn svg { flex-shrink: 0; }

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(148, 163, 184, 0.28);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== Region Selector ===== */
.region-selector-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    margin: 16px 0;
    border: 1px solid var(--border-color);
}

.region-selector-panel > span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.region-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.60);
    font-size: 13px;
    color: var(--text-secondary);
}

.region-option:has(input:checked) {
    background: rgba(37, 99, 235, 0.10);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ===== AI Tools ===== */
.ai-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px 0;
}

.ai-tool-panel {
    padding: 20px;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.ai-tool-panel h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}

.ai-tool-panel > p {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.ai-tool-panel input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
    display: block;
    margin-bottom: 8px;
}

.ai-tool-panel input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.ai-tool-panel input[type="text"]::placeholder {
    color: var(--text-muted);
}

.search-links-panel {
    padding: 14px 16px;
    background: rgba(16, 185, 129, 0.06);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border: 1px solid rgba(16, 185, 129, 0.20);
}

.search-links-panel h4 {
    margin-bottom: 12px;
    color: #065f46;
    font-size: 14px;
    font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .app-header {
        flex-direction: column;
        gap: 14px;
        border-radius: var(--radius-lg);
    }

    .nav-steps {
        flex-wrap: wrap;
        justify-content: center;
    }

    .cv-input-grid    { grid-template-columns: 1fr; }
    .results-grid     { grid-template-columns: 1fr; }
    .ai-tools-grid    { grid-template-columns: 1fr; }

    .dimension-weights {
        grid-template-columns: repeat(3, 1fr);
    }

    .role-item {
        flex-direction: column;
    }

    .role-rank {
        width: 100%;
        padding: 12px;
    }

    .role-skills {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .processing-steps {
        min-width: unset;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .section-header h1  { font-size: 24px; }
    .questionnaire-card { padding: 20px; }

    .question-item {
        flex-direction: column;
    }

    .section-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .dimension-weights { grid-template-columns: repeat(2, 1fr); }
    .chart-container   { height: 260px; }

    .job-card-header {
        flex-direction: column;
        gap: 10px;
    }

    .job-match-badge {
        flex-direction: row;
        gap: 6px;
        width: fit-content;
        height: auto;
        padding: 6px 12px;
    }

    .match-score { font-size: 18px; }

    .job-meta { gap: 4px 10px; }

    .job-actions { justify-content: stretch; }
    .btn-apply   { width: 100%; }
}
