/* ==========================================================================
   ANALYZE PAGE - Job Description Lead Capture
   Uses explore-detail.css classes for metrics, taxonomy, and chart layout.
   This file only contains analyze-specific styles.
   ========================================================================== */

.analyze-main {
    min-height: calc(100vh - var(--nav-height) - var(--banner-height, 0px));
    background: var(--bg_color);
}

.analyze-section {
    padding: var(--spacing-3xl) var(--spacing-lg);
    opacity: 1;
    transition: opacity 0.15s ease;
}

.analyze-section.fade-out {
    opacity: 0;
}

/* Suppress transitions on initial page load — handled by inline <style> in template */

/* =========================
     Section 1: Paste & Analyze Hero
=========================== */
#paste-section {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-height) - var(--banner-height, 0px));
    height: calc(100dvh - var(--nav-height) - var(--banner-height, 0px));
    min-height: 500px;
    overflow: hidden;
    box-sizing: border-box;
    /* Center content vertically via padding — animatable unlike justify-content */
    padding-top: 25vh;
    /* padding-top: calc((100vh - var(--nav-height) - var(--banner-height, 0px) - 420px) / 2 - var(--nav-height)); */
    transition: padding-top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.analyze-hero {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    flex-shrink: 0;
}

#paste-section.has-content {
    padding-top: var(--spacing-xl);
}

#paste-section.has-content .analyze-box-wrapper {
    padding-bottom: var(--spacing-lg);
    /* Height driven by textarea's JS-animated height, not flex */
    min-height: 0;
}

/* When content is present, let the box and textarea fill remaining space via flex */
#paste-section.has-content .analyze-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

#paste-section.has-content .analyze-textarea {
    /* Height driven by JS to animate smoothly with section padding */
}


/* Position the box in the upper portion of remaining space */
.analyze-box-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: var(--spacing-xl);
}

.analyze-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--blue-primary);
    background: var(--blue_1_10);
    border: 1px solid var(--blue_1_20);
    margin-bottom: var(--spacing-lg);
}

.analyze-badge-success {
    color: var(--data-success);
    background: var(--green_1_10);
    border-color: rgba(5, 150, 105, 0.2);
}

.analyze-hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: var(--font-bold);
    line-height: 1.15;
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md);
}

.hero-accent {
    color: var(--blue-primary);
}

.analyze-hero-subtitle {
    font-size: var(--text-base, 16px);
    color: var(--text-tertiary);
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--spacing-xl);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================
     Combined Box (steps + textarea)
=========================== */
.analyze-box {
    width: 100%;
    background: var(--fg_color);
    border: 1px solid var(--line_color);
    border-radius: 8px;
}

/* Steps row: collapses smoothly when content is present */
.analyze-steps-row {
    display: grid;
    grid-template-rows: 1fr;
    border-bottom: 1px solid var(--line_color);
    overflow: hidden;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-bottom-color 0.3s ease;
}

.analyze-box.has-content .analyze-steps-row {
    grid-template-rows: 0fr;
    border-bottom-color: transparent;
}

.analyze-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: 16px 20px;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.analyze-box.has-content .analyze-steps {
    opacity: 0;
}

.analyze-step-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.analyze-step-number {
    font-size: 11px;
    font-weight: 600;
    color: var(--blue-primary);
    letter-spacing: 0.05em;
}

.analyze-step-text {
    font-size: var(--text-sm, 14px);
    color: var(--text-secondary);
}

.analyze-step-divider {
    width: 24px;
    height: 1px;
    background: var(--line_color);
}

/* Textarea: height driven by JS with CSS transition */
.analyze-textarea {
    display: block;
    width: 100%;
    height: 100px;
    padding: 20px;
    border: none;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    resize: none;
    font-family: var(--font-family);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
    background: transparent;
    box-sizing: border-box;
    overflow-y: auto;
    /* Height driven by JS rAF loop to stay in sync with section padding transition */
}

.analyze-textarea:focus,
.analyze-textarea:focus-visible {
    outline: none !important;
    box-shadow: none;
    border: none;
}

.dark-mode .analyze-textarea {
    color: #e5e5e5;
}

.dark-mode .analyze-hero-subtitle,
.dark-mode .analyze-char-counter,
.dark-mode .analyze-loading-subtitle,
.dark-mode .analyze-step-inner {
    color: #525252;
}

.dark-mode .analyze-step.active .analyze-step-inner,
.dark-mode .analyze-step.active .analyze-step-inner * {
    color: #60A5FA !important;
}

.dark-mode .hero-accent {
    color: #60A5FA;
}

.dark-mode .analyze-step-number {
    color: #60A5FA;
}

.analyze-textarea::placeholder {
    color: var(--text-tertiary);
}

/* Actions bar below textarea */
.analyze-textarea-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--line_color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analyze-box.has-content .analyze-textarea-actions {
    opacity: 1;
}

.analyze-char-counter {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* Pulse animation removed */

/* =========================
     Section 2: Loading
=========================== */
#loading-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-height: calc(100vh - var(--nav-height) - var(--banner-height, 0px));
    min-height: calc(100dvh - var(--nav-height) - var(--banner-height, 0px));
}

#loading-section.hidden {
    display: none;
}

.analyze-loading-container {
    text-align: left;
    max-width: 480px;
    /* Shift content up visually without adding height to the section */
    transform: translateY(calc(-1 * (var(--nav-height) + var(--banner-height, 0px)) / 2));
}

/* Small inline spinner for loading steps */
.step-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--line_color);
    border-top-color: var(--blue-primary);
    border-radius: 50%;
    animation: analyze-spin 0.8s linear infinite;
    vertical-align: middle;
    opacity: 0;
}

.analyze-step.active .step-spinner { opacity: 1; }

.step-check {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    color: var(--data-success, #22c55e);
}

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

.analyze-loading-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--spacing-sm);
}

.analyze-loading-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-xl);
}

.analyze-progress-steps {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.analyze-step {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.4s ease, opacity 0.3s ease;
}

.analyze-step-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    overflow: hidden;
    padding: 6px 0;
}

.analyze-step .step-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.analyze-step.complete {
    grid-template-rows: 0fr;
    opacity: 0;
}

.analyze-step.active .analyze-step-inner { color: var(--blue-primary); }
.analyze-step.active .step-icon { color: var(--blue-primary); }

/* =========================
     Section 3: Report
=========================== */
.analyze-report-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-medium);
}

.analyze-report-header {
    margin-bottom: var(--spacing-xl);
}

.analyze-report-header-top {
    display: flex;
    gap: var(--spacing-xl);
    align-items: center;
}

.analyze-report-header-left {
    flex-shrink: 0;
}

.analyze-report-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: var(--spacing-sm) 0 var(--spacing-sm);
}

.analyze-report-meta-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.analyze-report-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: 0;
}

.analyze-report-summary {
    color: var(--text-secondary, #6b7280);
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
    margin: var(--spacing-sm) 0 0;
    padding-top: var(--spacing-sm);
    text-align: right;
}

@media (max-width: 768px) {
    .analyze-report-header-top {
        flex-direction: column;
    }
}

.analyze-report-meta span {
    display: none; /* shown via JS when value is present */
    align-items: center;
    gap: 6px;
}

.analyze-skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.analyze-skill-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: var(--font-medium);
    color: var(--blue-primary);
    background: var(--blue_1_10);
    border: 1px solid var(--blue_1_20);
}

/* =========================
     Gated state
=========================== */

/* Gated metric cards: blur the values */
.gated-card .gated-value {
    filter: blur(8px);
    user-select: none;
}

.gated-card.unlocked .gated-value {
    filter: none;
    user-select: auto;
}

/* Gated content: blur charts and values */
.analyze-gated-content.gated .gated-value {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
}

.analyze-gated-content.gated .analyze-chart-placeholder {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

/* Blur the entire gated content section (charts, tables, etc.) */
.analyze-gated-content.gated {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
}

/* Email capture banner */
.analyze-email-banner {
    background: var(--blue_1_10, rgba(59,130,246,0.1));
    border: 1px solid var(--blue_1_20);
    border-radius: 4px;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xlarge);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.analyze-email-banner.hidden {
    display: none;
}

.analyze-email-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue_1_10);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    color: var(--blue-primary);
    font-size: 1rem;
}

.analyze-email-banner h3 {
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs);
}

.analyze-email-banner p {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-lg);
    line-height: var(--leading-relaxed);
}

.analyze-email-banner-form {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    max-width: 460px;
    margin: 0 auto;
}

.analyze-email-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line_color);
    border-radius: 4px;
    background: var(--fg_color);
    min-height: 40px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.analyze-email-input-wrapper:focus-within {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.analyze-email-input-wrapper i {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    flex-shrink: 0;
}

.analyze-email-input-wrapper input,
.analyze-email-input-wrapper input:focus,
.analyze-email-input-wrapper input:focus-visible {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    padding: 8px 0;
    font-size: var(--font-body-size);
    color: var(--text_color);
    font-family: var(--font-family);
    min-height: auto;
    width: 100%;
}

.analyze-email-input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.analyze-email-banner-form .btn-primary {
    flex-shrink: 0;
    white-space: nowrap;
}

.analyze-capture-error {
    margin-top: var(--spacing-sm);
    font-size: var(--text-xs);
    color: var(--status-error);
}

.analyze-capture-disclaimer {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: var(--spacing-sm) 0 0;
}

/* =========================
     Chart placeholder (gated state)
=========================== */
.analyze-chart-placeholder {
    width: 100%;
    height: 200px;
}

.analyze-chart-placeholder svg {
    width: 100%;
    height: 100%;
}

/* =========================
     Premium CTA
=========================== */
.analyze-premium-cta {
    background: var(--blue_1_10, rgba(59,130,246,0.1));
    border: 1px solid var(--blue_1_20);
    border-radius: 4px;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.analyze-premium-cta-title {
    font-size: var(--text-md);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.analyze-premium-cta-title i { color: var(--blue-primary); }

.analyze-premium-cta-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-lg);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================
   Conversion CTA (post-capture)
=========================== */
.analyze-conversion-cta {
    background: var(--blue_1_10, rgba(59,130,246,0.1));
    border: 1px solid var(--blue_1_20);
    border-radius: 4px;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}
.analyze-conversion-cta-title {
    font-size: var(--text-md);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.analyze-conversion-cta-title i { color: var(--blue-primary); }
.analyze-conversion-cta-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-lg);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Report footer */
.analyze-report-footer {
    display: flex;
    align-items: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--line_color);
}

.analyze-report-disclaimer {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* =========================
     Comp Breakdown Table
=========================== */
.comp-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
.comp-breakdown-table th,
.comp-breakdown-table td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border_color);
}
.comp-breakdown-table th:first-child,
.comp-breakdown-table td:first-child {
    text-align: left;
}
.comp-breakdown-table th {
    font-weight: 600;
    color: var(--text_secondary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.comp-breakdown-table tr:last-child td {
    border-bottom: none;
}

/* =========================
     Responsive
=========================== */
@media (max-width: 767px) {
    .analyze-section { padding: var(--spacing-xl) var(--spacing-md); }
    .analyze-steps {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    .analyze-step-divider { display: none; }
    .analyze-email-banner-form { flex-direction: column; }
    .analyze-report-footer {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }
    .analyze-report-meta {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    .seniority-breakdown-bands { overflow-x: auto; }
    .seniority-breakdown-bands::-webkit-scrollbar { display: none; }
}

/* =========================
   Seniority Breakdown
=========================== */
.seniority-breakdown-panel {
    grid-column: 1 / -1;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
}
.seniority-breakdown-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary, #1f2937);
}
/* ── Low data notice ── */
.report-low-data-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: var(--spacing-lg, 1.5rem);
    background: var(--card-bg, #fff);
    border: 1px solid var(--warning-border, #fbbf24);
    border-radius: 0.5rem;
    color: var(--text-primary, #1f2937);
}
.report-low-data-notice.hidden { display: none; }
.low-data-icon {
    flex-shrink: 0;
    color: var(--warning-color, #d97706);
    margin-top: 0.1rem;
}
.low-data-content strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}
.low-data-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}

/* ── Horizontal box-whisker chart ── */
.report-whisker-panel {
    margin-bottom: var(--spacing-lg, 1.5rem);
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    padding: 1.25rem 0.75rem 0.75rem;
}
.report-whisker-chart {
    width: 100%;
    overflow: visible;
}
.report-whisker-svg {
    display: block;
    width: 100%;
    overflow: visible;
}
.report-whisker-svg {
    width: 100%;
    height: auto;
    max-height: 90px;
}
.whisker-label {
    font-size: 11px;
    font-weight: 700;
    fill: var(--text-primary, #1f2937);
}
.whisker-label-median {
    font-size: 12px;
    fill: var(--blue-primary, #3663eb);
}
.whisker-pct-label {
    font-size: 9px;
    fill: var(--text-secondary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.whisker-posted-label {
    font-size: 9px;
    font-weight: 700;
}
.whisker-posted-tag {
    font-size: 8px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Seniority table rows ── */
.seniority-code {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    background: var(--bg-secondary, #f3f4f6);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #6b7280);
}
.seniority-active-row {
    background: var(--blue-primary-light, rgba(59,130,246,0.08));
}
.seniority-active-row .seniority-code {
    background: var(--blue-primary, #3b82f6);
    color: #fff;
}
.seniority-salary {
    font-weight: 700;
    text-align: left;
}

/* =========================
   Export Button
=========================== */
.btn-export-report {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #374151);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.btn-export-report:hover { border-color: var(--blue-primary, #3b82f6); background: #f0f4ff; color: var(--blue-primary, #3b82f6); }

/* =========================
   Skill match indicators
   ========================= */
.skill-match-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue-primary, #3b82f6);
    margin-right: 0.5rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.posting-only-skills {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.8;
}
.posting-only-label {
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin-right: 0.25rem;
}
.posting-only-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    margin: 0.15rem 0.2rem;
    border-radius: 999px;
    background: var(--surface-secondary, #f3f4f6);
    color: var(--text-primary, #374151);
    font-size: 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
}

/* ── Specialization notice ── */
.specialization-notice {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--surface-secondary, #f0f4ff);
    border: 1px solid var(--border-color, #d1d9f0);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary, #1f2937);
}
.specialization-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}
.specialization-icon {
    color: var(--accent-color, #6366f1);
    font-size: 0.7rem;
}
.specialization-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}
.specialization-tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--accent-bg, #eef2ff);
    color: var(--accent-color, #4f46e5);
    font-size: 0.75rem;
    border: 1px solid var(--accent-border, #c7d2fe);
}
.low-confidence-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--warning-bg, #fffbeb);
    color: var(--warning-color, #d97706);
    font-size: 0.7rem;
    border: 1px solid var(--warning-border, #fde68a);
    margin-left: 0.35rem;
}
.dark-mode .posting-only-pill {
    background: var(--primary_3, #2a2d35);
    color: var(--text_color_shiny, #a1a1aa);
    border-color: var(--line_color, #3f3f46);
}

/* ==========================================================================
   ROLE DNA PANEL
   ========================================================================== */

.report-role-dna-panel {
    background: var(--card-bg, var(--primary_2, #f9fafb));
    border: 1px solid var(--line_color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.role-dna-header {
    display: none;
}
.role-dna-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text_color, #111827);
    margin: 0;
}
.role-dna-coherence-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.role-dna-coherence-badge.pure-role {
    background: #dcfce7; color: #166534;
}
.role-dna-coherence-badge.moderate-hybrid {
    background: #fef9c3; color: #854d0e;
}
.role-dna-coherence-badge.strong-hybrid {
    background: #fee2e2; color: #991b1b;
}
.dark-mode .role-dna-coherence-badge.pure-role {
    background: #14532d; color: #86efac;
}
.dark-mode .role-dna-coherence-badge.moderate-hybrid {
    background: #713f12; color: #fde047;
}
.dark-mode .role-dna-coherence-badge.strong-hybrid {
    background: #7f1d1d; color: #fca5a5;
}
.role-dna-headline {
    font-size: 0.9rem;
    color: var(--text_color_secondary, #6b7280);
    line-height: 1.5;
    margin: 0 0 1rem;
}
.role-dna-bar {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    height: 2rem;
    margin-bottom: 0.75rem;
}
.role-dna-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 2%;
    transition: width 0.3s ease;
}
.role-dna-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}
.role-dna-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text_color, #111827);
}
.role-dna-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.role-dna-legend-pct {
    color: var(--text_color_secondary, #6b7280);
}
.role-dna-premiums {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.role-dna-premium-box {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    background: var(--primary_3, #f3f4f6);
    border: 1px solid var(--line_color, #e5e7eb);
}
.role-dna-premium-label {
    font-size: 0.7rem;
    color: var(--text_color_secondary, #6b7280);
}
.role-dna-premium-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #16a34a;
}
.role-dna-detail-toggle {
    background: none;
    border: none;
    color: var(--text_color_secondary, #6b7280);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.5rem;
}
.role-dna-detail-toggle:hover {
    color: var(--text_color, #111827);
}
.role-dna-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    color: var(--text_color, #111827);
}
.role-dna-detail-row.total {
    border-top: 1px solid var(--line_color, #e5e7eb);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    font-weight: 600;
}
.role-dna-detail-comp {
    font-family: var(--font-mono, monospace);
}
.role-dna-match-count {
    font-size: 0.75rem;
    color: var(--text_color_secondary, #6b7280);
    margin: 0.5rem 0 0;
}

/* ── Flag Report Button (inline with meta) ── */
.flag-report-footer {
    text-align: center;
    padding: var(--spacing-xl, 2rem) 0;
    margin-top: var(--spacing-lg, 1.5rem);
}
.flag-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0;
    font-size: var(--text-xs, 0.75rem);
    color: var(--text_color_secondary, #9ca3af);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    white-space: nowrap;
}
.flag-report-btn:hover {
    color: #ef4444;
}

/* ── Flag Report Modal (matches feedback modal) ── */
.flag-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    z-index: 9999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.5) !important;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.flag-overlay.open { display: flex !important; }
.flag-overlay.visible { opacity: 1; }

.flag-overlay-content {
    background: var(--fg_color, #fff);
    color: var(--text_color, #1a1a2e);
    border-radius: 12px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}
.flag-overlay.visible .flag-overlay-content { transform: translateY(0); }

.flag-overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary, #9ca3af);
    line-height: 1;
}
.flag-overlay-close:hover { color: var(--text_color, #1a1a2e); }

.flag-overlay-title {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
}
.flag-overlay-subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary, #9ca3af);
}

.flag-field { margin-bottom: 1rem; }
.flag-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-secondary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.flag-field label .required { color: #ef4444; }
.flag-field select,
.flag-field textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line_color, #e5e7eb);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--fg_color, #fff);
    color: var(--text_color, #1a1a2e);
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.flag-field select:focus,
.flag-field textarea:focus {
    outline: none;
    border-color: var(--blue-primary, #3663eb);
}
.flag-field textarea { resize: vertical; min-height: 100px; }
.flag-char-counter {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary, #9ca3af);
    margin-top: 0.25rem;
}

.flag-submit-btn {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--blue-primary, #3663eb);
    color: #fff;
    transition: opacity 0.15s;
}
.flag-submit-btn:hover { opacity: 0.9; }
.flag-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.flag-btn-secondary {
    background: transparent;
    color: var(--text_color, #1a1a2e);
    border: 1px solid var(--line_color, #e5e7eb);
    margin-top: 0.75rem;
}

.flag-error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.flag-success-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.flag-success-text {
    text-align: center;
    margin-bottom: 0.5rem;
}
