/* ─── Design Tokens ─────────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg:              #0E0F13;
    --surface:         #16171D;
    --surface-hover:   #1C1D25;
    --card:            #1A1B23;
    --card-border:     #25262F;
    --border:          #2A2B35;
    --border-subtle:   #1F2029;

    /* Text */
    --text:            #E8E9ED;
    --text-secondary:  #8B8D98;
    --text-muted:      #5C5E6A;

    /* Accent (indigo) */
    --accent:          #6C72CB;
    --accent-light:    #8187D6;
    --accent-bg:       rgba(108,114,203,0.08);
    --accent-border:   rgba(108,114,203,0.2);

    /* Semantic */
    --green:           #3DD68C;
    --green-bg:        rgba(61,214,140,0.06);
    --green-border:    rgba(61,214,140,0.15);
    --yellow:          #F0C246;
    --yellow-bg:       rgba(240,194,70,0.06);
    --yellow-border:   rgba(240,194,70,0.2);
    --red:             #E5574F;
    --red-bg:          rgba(229,87,79,0.06);
    --red-border:      rgba(229,87,79,0.15);

    /* Typography */
    --font:            'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Radii */
    --radius-sm:       6px;
    --radius-md:       10px;
    --radius-lg:       14px;
    --radius-xl:       16px;
}

/* ─── Keyframes ────────────────────────────────────────── */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes spinPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.1) rotate(3deg); opacity: 1; }
}

@keyframes pulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}

@keyframes landing-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    margin: 0;
    overflow: hidden;
    height: 100vh;
}

/* ─── App Layout ────────────────────────────────────────── */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ─── Top Bar ───────────────────────────────────────────── */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    height: 52px;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-bar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-bar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.top-bar-home {
    cursor: pointer;
}

.top-bar-badge {
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    margin-left: 4px;
}

.btn-download-top {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    font-family: var(--font);
    transition: all 0.15s ease;
}

.btn-download-top:hover {
    background: var(--surface-hover);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-reset-top {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-reset-top:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--text-muted);
}

/* ─── Main Content ──────────────────────────────────────── */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ─── Chat Panel ────────────────────────────────────────── */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: flex 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-panel.with-preview {
    flex: 0 0 45%;
    border-right: 1px solid var(--border-subtle);
}

/* ─── Step Indicator ────────────────────────────────────── */
.step-indicator {
    display: flex;
    gap: 2px;
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-bar {
    height: 3px;
    width: 100%;
    border-radius: 2px;
    background: var(--border);
    transition: all 0.4s ease;
}

.step-bar.completed {
    background: var(--step-accent, var(--accent));
}

.step-bar.active {
    background: linear-gradient(90deg, var(--step-accent, var(--accent)), var(--step-accent-light, var(--accent-light)));
}

.step-label {
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 400;
    transition: all 0.4s ease;
}

.step-label.reached {
    color: var(--text);
}

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

/* ─── Chat Messages ─────────────────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.chat-messages > * {
    max-width: 680px;
    width: calc(100% - 40px);
}

/* ─── Chat Message ──────────────────────────────────────── */
.message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.message.visible {
    opacity: 1;
    transform: translateY(0);
}

.bot-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 2px;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.message-bubble {
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text);
    max-width: 100%;
}

.message-bot .message-bubble {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 4px 14px 14px 14px;
    flex: 1;
}

.message-user {
    flex-direction: row-reverse;
}

.message-user .message-bubble {
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: 14px 4px 14px 14px;
    max-width: 85%;
    margin-left: auto;
}

.message-error .message-bubble {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: 4px 14px 14px 14px;
    flex: 1;
}

.message-bubble p {
    margin-bottom: 8px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

/* ─── Upload Drop Zone ──────────────────────────────────── */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 8px 0;
}

.upload-dropzone:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.upload-dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.upload-dropzone-icon {
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.upload-dropzone.drag-over .upload-dropzone-icon {
    color: var(--accent);
}

.upload-dropzone-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-dropzone-text strong {
    color: var(--text);
    font-weight: 500;
}

.upload-dropzone-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Project Cards ─────────────────────────────────────── */
.project-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: var(--card);
    overflow: hidden;
    transition: all 0.2s ease;
    opacity: 1;
}

.project-card.unchecked {
    background: transparent;
    border-color: var(--border);
    opacity: 0.5;
}

.project-card.locked .project-card-main {
    cursor: default;
    pointer-events: none;
}

.project-card.locked .project-checkbox {
    opacity: 0.4;
    cursor: default;
}

.project-card.locked .project-checkbox.checked {
    background: var(--text-muted);
    border-color: var(--text-muted);
}

/* ─── Project Groups (parent + sub-projects) ───────────── */
.project-group {
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: var(--card);
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.project-group.unchecked {
    opacity: 0.5;
}

.project-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
}

.project-group-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.project-group-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.project-group-checkbox.indeterminate {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.project-group-checkbox .indeterminate-dash {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.project-group-info {
    flex: 1;
    min-width: 0;
}

.project-group-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.project-group-dates {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.project-group-children {
    display: flex;
    flex-direction: column;
}

.project-group-children .project-card {
    border: none;
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding-left: 16px;
}

.project-group-children .project-card:last-child {
    border-bottom: none;
}

.project-group-header.locked,
.project-group-header.frozen {
    cursor: default;
    pointer-events: none;
}

.project-group-header.locked .project-group-checkbox {
    opacity: 0.4;
    cursor: default;
}

.project-group-header.locked .project-group-checkbox.checked {
    background: var(--text-muted);
    border-color: var(--text-muted);
}

.project-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
}

.project-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--text-muted);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    cursor: pointer;
}

.project-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.project-dates {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.project-badge {
    font-size: 10.5px;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    font-weight: 500;
}

.badge-matched {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    color: var(--green);
}

.badge-pending {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    color: var(--yellow);
}

.badge-rejected {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.badge-unmatched {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
}

/* Pending confirmation row */
.project-pending-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--border-subtle);
    background: var(--yellow-bg);
}

.project-pending-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.project-pending-text strong {
    font-weight: 500;
    color: var(--text);
}

.project-pending-actions {
    display: flex;
    gap: 6px;
}

.btn-match-yes {
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    font-family: var(--font);
}

.btn-match-no {
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    font-family: var(--font);
}

/* ─── Seniority Selector ────────────────────────────────── */
.seniority-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.seniority-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font);
}

.seniority-btn.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ─── Settings Selector ─────────────────────────────────── */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-group-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.settings-buttons {
    display: flex;
    gap: 8px;
}

.setting-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font);
}

.setting-btn.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.setting-btn-detail {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.setting-btn-detail.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.setting-btn-hint {
    font-size: 10px;
    opacity: 0.7;
}

/* ─── Profile Step (Gender + Name) ──────────────────────── */
.profile-name-check {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-name-question {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.profile-name-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-name-input-wrap {
    flex: 1;
}

.profile-name-input {
    width: 100%;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.profile-name-input:focus {
    border-color: var(--accent);
}

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

/* ─── Continue Button ───────────────────────────────────── */
.btn-continue {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s ease;
    margin-left: auto;
}

.btn-continue:hover {
    filter: brightness(1.1);
}

.continue-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* ─── Employee Questions Block ──────────────────────────── */
.questions-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.questions-block-project {
    font-weight: 600;
    color: var(--accent-light);
    font-size: 12.5px;
    margin-bottom: 6px;
}

.questions-block ol {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 20px;
    margin: 0;
}

.questions-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ─── Input Bar ─────────────────────────────────────────── */
.input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
    background: var(--surface);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.input-bar.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.input-bar textarea {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: var(--font);
    rows: 2;
}

.input-bar textarea:focus {
    border-color: var(--accent);
}

.btn-send {
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--border);
    color: var(--text-muted);
    cursor: default;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: flex-end;
}

.btn-send.active {
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

/* ─── Preview Panel ─────────────────────────────────────── */
.preview-panel {
    flex: 0 0 55%;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg);
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.preview-header h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.preview-legend {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.preview-legend-text {
    font-size: 11px;
    color: var(--text-muted);
}

.preview-sections {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.preview-sections.dimmed {
    opacity: 0.4;
}

/* ─── Preview Section Card ──────────────────────────────── */
.preview-section {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--card);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
}

.preview-section:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.preview-section.modified {
    border-left: 3px solid var(--green);
    border-color: var(--green-border);
}

.preview-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.preview-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.preview-section-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-modified {
    font-size: 10px;
    color: var(--green);
    font-weight: 500;
}

.preview-edit-icon {
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.preview-section:hover .preview-edit-icon {
    opacity: 1;
}

.preview-section-content {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
}

/* ─── Preview Project Card ──────────────────────────────── */
.preview-project {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--card);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.preview-project:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.preview-project.modified {
    border-left: 3px solid var(--green);
    border-color: var(--green-border);
}

.preview-project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.preview-project-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.preview-project-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-project-dates {
    font-size: 11px;
    color: var(--text-muted);
}

.preview-project .preview-edit-icon {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.preview-project:hover .preview-edit-icon {
    opacity: 1;
}

/* ─── Staggered Reveal Animation ───────────────────────── */
@keyframes sectionReveal {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-reveal {
    animation: sectionReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.section-reveal--delay-0 { animation-delay: 0ms; }
.section-reveal--delay-1 { animation-delay: 70ms; }
.section-reveal--delay-2 { animation-delay: 140ms; }
.section-reveal--delay-3 { animation-delay: 210ms; }
.section-reveal--delay-4 { animation-delay: 280ms; }
.section-reveal--delay-5 { animation-delay: 350ms; }
.section-reveal--delay-6 { animation-delay: 420ms; }
.section-reveal--delay-7 { animation-delay: 490ms; }
.section-reveal--delay-8 { animation-delay: 560ms; }

/* Subsection labels */
.preview-subsection-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 8px;
}

.preview-subsection-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-top: 4px;
}

/* Technology chips */
.preview-tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.tech-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    color: var(--accent-light);
}

/* Responsibilities */
.preview-responsibilities {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.preview-responsibilities li {
    margin-bottom: 2px;
}

.preview-responsibilities li.highlight-modified {
    color: var(--green);
}

/* Experience header */
.preview-experience-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 8px;
}

/* ─── Loading Overlay ───────────────────────────────────── */
.preview-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(14,15,19,0.7);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.preview-loading-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #8B6CC1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    animation: spinPulse 1.5s ease-in-out infinite;
}

.preview-loading-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ─── Shimmer Skeleton ─────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--surface) 25%,
        var(--surface-hover) 50%,
        var(--surface) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}

.skeleton-block {
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--card-border);
    padding: 14px 16px;
}

.skeleton-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(
        90deg,
        var(--surface) 25%,
        var(--surface-hover) 50%,
        var(--surface) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}

.skeleton-dot--lg { width: 8px; height: 8px; }

/* Width modifiers */
.skeleton-line--w20  { width: 20%; }
.skeleton-line--w28  { width: 28%; }
.skeleton-line--w30  { width: 30%; }
.skeleton-line--w32  { width: 32%; }
.skeleton-line--w35  { width: 35%; }
.skeleton-line--w42  { width: 42%; }
.skeleton-line--w45  { width: 45%; }
.skeleton-line--w48  { width: 48%; }
.skeleton-line--w55  { width: 55%; }
.skeleton-line--w60  { width: 60%; }
.skeleton-line--w62  { width: 62%; }
.skeleton-line--w68  { width: 68%; }
.skeleton-line--w70  { width: 70%; }
.skeleton-line--w75  { width: 75%; }
.skeleton-line--w76  { width: 76%; }
.skeleton-line--w78  { width: 78%; }
.skeleton-line--w82  { width: 82%; }
.skeleton-line--w88  { width: 88%; }
.skeleton-line--w90  { width: 90%; }
.skeleton-line--w92  { width: 92%; }
.skeleton-line--w96  { width: 96%; }
.skeleton-line--w100 { width: 100%; }

/* Height modifiers */
.skeleton-line--h5   { height: 5px; border-radius: 3px; }
.skeleton-line--h9   { height: 9px; }
.skeleton-line--h10  { height: 10px; }
.skeleton-line--h11  { height: 11px; }
.skeleton-line--h12  { height: 12px; }
.skeleton-line--h13  { height: 13px; }
.skeleton-line--h14  { height: 14px; }
.skeleton-line--h22  { height: 22px; border-radius: 6px; }
.skeleton-line--tall { height: 38px; border-radius: 10px; }

/* Animation delay modifiers (stagger) */
.skeleton-line--d0 { animation-delay: 0s; }
.skeleton-line--d1 { animation-delay: 0.06s; }
.skeleton-line--d2 { animation-delay: 0.12s; }
.skeleton-line--d3 { animation-delay: 0.18s; }
.skeleton-line--d4 { animation-delay: 0.24s; }
.skeleton-line--d5 { animation-delay: 0.30s; }
.skeleton-line--d6 { animation-delay: 0.36s; }

/* ─── Loading Dots ──────────────────────────────────────── */
.loading-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.loading-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.2s ease-in-out infinite;
}

.loading-dots .dot:nth-child(1) { animation-delay: 0s; }
.loading-dots .dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.3s; }

/* ─── Edit Modal ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    width: 560px;
    max-height: 80vh;
    overflow: auto;
    padding: 24px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.btn-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.btn-modal-close:hover {
    color: var(--text);
}

/* Modal fields */
.modal-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.modal-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    display: block;
}

.modal-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.modal-clear-btn:hover {
    opacity: 1;
    color: var(--error);
    background: rgba(255, 59, 48, 0.1);
}

.modal-textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: var(--font);
}

.modal-textarea:focus {
    border-color: var(--accent);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-modal-cancel {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font);
}

.btn-modal-cancel:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-modal-save {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-family: var(--font);
}

.btn-modal-save:hover {
    filter: brightness(1.1);
}

/* ─── File attachment display ───────────────────────────── */
.file-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-attachment-name {
    font-size: 13px;
}

.file-attachment-size {
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── Utility ───────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ─── Login Screen (Hero Landing) ─────────────────────── */
.login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 200;
    overflow: hidden;
}

.landing-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 60% 40%, rgba(108,114,203,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 20% 70%, rgba(139,102,193,0.1) 0%, transparent 60%);
}

.landing-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Nav ── */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
}

.landing-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.landing-nav-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.landing-nav-signin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    background: #fff;
    color: #333;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    text-decoration: none;
    font-family: var(--font);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.landing-nav-signin:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

/* ── Hero Section ── */
.landing-hero {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 0 48px 60px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ── Left Column ── */
.landing-hero-left {
    flex: 0 0 50%;
    max-width: 560px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    color: var(--accent-light);
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 24px;
}

.landing-heading {
    font-size: clamp(36px, 4vw, 52px);
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
}

.landing-heading-accent {
    color: var(--accent-light);
}

.landing-subheading {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 32px;
    max-width: 440px;
}

.landing-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 36px;
}

.landing-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-check-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    flex-shrink: 0;
}

.landing-check-item span {
    font-size: 14.5px;
    color: var(--text);
    font-weight: 500;
}

.landing-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    background: #fff;
    color: #333;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    font-family: var(--font);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.landing-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.landing-cta-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 14px;
}

.login-error {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--red);
    background: var(--red-bg);
    border: 1px solid var(--red-border);
}

/* ── Right Column ── */
.landing-hero-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 380px;
}

.landing-avatar {
    width: 160px;
    height: 160px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.landing-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 40px;
    object-fit: cover;
    box-shadow: 0 0 60px rgba(108,114,203,0.4), 0 0 120px rgba(108,114,203,0.15);
}

.landing-ring {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 1px solid var(--border);
    z-index: 1;
    animation: landing-spin 20s linear infinite;
}

/* ── Floating Cards ── */
.landing-float-card {
    position: absolute;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    opacity: 0.35;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-float-card.active {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.landing-float-0 {
    top: 4%;
    right: 0%;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
}

.landing-float-1 {
    bottom: 18%;
    right: -4%;
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
}

.landing-float-2 {
    top: 36%;
    left: -8%;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
}

.landing-float-3 {
    bottom: 4%;
    left: 2%;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
}

.landing-float-icon {
    font-size: 16px;
}

.landing-float-text {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

.landing-float-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* Logout button in top bar */
.btn-logout-top {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-logout-top:hover {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .chat-panel.with-preview {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .preview-panel {
        flex: 1;
        max-height: 50vh;
    }

    .message-user .message-bubble {
        max-width: 95%;
    }

    .chat-messages > * {
        width: calc(100% - 32px);
    }

    /* Landing responsive */
    .landing-nav {
        padding: 16px 20px;
    }

    .landing-hero {
        flex-direction: column;
        padding: 0 20px 40px;
        gap: 32px;
    }

    .landing-hero-left {
        flex: none;
        max-width: 100%;
    }

    .landing-hero-right {
        display: none;
    }
}

/* ─── Frozen state (complete step) ─────────────────────────────── */
.frozen {
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.25s ease;
}

/* ─── Top Bar: Separator & Mode Badge ────────────────────── */
.top-bar-sep {
    color: var(--border);
    font-size: 14px;
    margin-left: 4px;
}

.top-bar-mode-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    font-weight: 500;
}

/* ─── Top Bar Button Tooltips ────────────────────────────── */
.top-btn-wrapper {
    position: relative;
}

.top-btn-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    white-space: nowrap;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11.5px;
    color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.top-btn-wrapper:hover .top-btn-tooltip {
    opacity: 1;
}

/* ─── Mode Select Screen ────────────────────────────────── */
#modeSelectScreen .app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.mode-select-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.mode-select-header {
    text-align: center;
    margin-bottom: 40px;
}

.mode-select-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.mode-select-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.mode-cards {
    display: flex;
    gap: 16px;
    max-width: 900px;
    width: 100%;
}

/* ─── Mode Card ─────────────────────────────────────────── */
.mode-card {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 24px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-card:hover {
    background: var(--surface-hover);
    transform: translateY(-4px) scale(1.012);
    box-shadow: 0 12px 32px rgba(0,0,0,0.35),
                inset 0 1px 0 rgba(255,255,255,0.05);
}

.mode-card--disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.mode-card[data-mode="analyze"]:hover { border-color: var(--yellow-border); }
.mode-card[data-mode="enrich"]:not(.mode-card--disabled):hover  { border-color: var(--green-border); }
.mode-card[data-mode="tailor"]:hover  { border-color: var(--accent-border); }

.mode-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1);
}

.mode-card:hover .mode-card-icon {
    transform: scale(1.1);
}

.mode-card:hover .mode-card-icon--yellow {
    box-shadow: 0 0 16px rgba(240, 194, 70, 0.4);
}

.mode-card:hover .mode-card-icon--green {
    box-shadow: 0 0 16px rgba(61, 214, 140, 0.4);
}

.mode-card:hover .mode-card-icon--accent {
    box-shadow: 0 0 16px rgba(108, 114, 203, 0.4);
}

.mode-card-icon--yellow {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    color: var(--yellow);
}

.mode-card-icon--green {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    color: var(--green);
}

.mode-card-icon--accent {
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    color: var(--accent);
}

.mode-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.mode-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.mode-card-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mode-card-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-card-step span {
    font-size: 12px;
    color: var(--text-muted);
}

.mode-card-step-num {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.mode-card-step-num--yellow {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    color: var(--yellow);
}

.mode-card-step-num--green {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    color: var(--green);
}

.mode-card-step-num--accent {
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    color: var(--accent);
}

.mode-card-cta {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.7;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.mode-card:hover .mode-card-cta { opacity: 1; }

.mode-card-cta--yellow { color: var(--yellow); }
.mode-card-cta--green  { color: var(--green); }
.mode-card-cta--accent { color: var(--accent); }

.mode-card:hover .mode-card-cta--yellow,
.mode-card:hover .mode-card-cta--green,
.mode-card:hover .mode-card-cta--accent {
    opacity: 1;
    transform: translateX(2px);
}

/* ─── Confirmation Modals ───────────────────────────────── */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.confirm-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    width: 420px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}

.confirm-card--sm {
    width: 380px;
}

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

.confirm-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.confirm-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.confirm-icon--red {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
}

.confirm-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
}

.confirm-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-confirm-cancel {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s ease;
}

.btn-confirm-cancel:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-confirm-danger {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid var(--red-border);
    background: var(--red-bg);
    color: var(--red);
    cursor: pointer;
    font-weight: 500;
    font-family: var(--font);
    transition: all 0.15s ease;
}

.btn-confirm-danger:hover {
    filter: brightness(1.1);
}

.btn-confirm-accent {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13px;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    font-family: var(--font);
    transition: all 0.15s ease;
}

.btn-confirm-accent:hover {
    filter: brightness(1.1);
}

/* ─── Stub Mode Layouts (Analyze / Enrich) ──────────────── */
#analyzeMode .app-container,
#enrichMode .app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#analyzeMode .chat-messages,
#enrichMode .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

/* ─── File Confirmed Block (for stubs) ──────────────────── */
.file-confirmed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
}

.file-confirmed-check {
    color: var(--green);
    font-size: 14px;
}

.file-confirmed-name {
    font-size: 13px;
    color: var(--text);
}

/* ─── Stub Upload Section Label ─────────────────────────── */
.stub-upload-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

/* ─── Responsive: Mode Cards ────────────────────────────── */
@media (max-width: 768px) {
    .mode-cards {
        flex-direction: column;
    }

    .mode-select-content {
        padding: 24px 16px;
    }
}

/* ─── Analyze Input Bar (hidden by default, shown via .visible) ── */
#analyzeInputBar {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    border-top-color: transparent;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-top-color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#analyzeInputBar.visible {
    max-height: 80px;
    padding-top: 12px;
    padding-bottom: 12px;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    border-top-color: var(--border-subtle);
}

/* ─── Analyze Mode ─────────────────────────────────────── */

.analyze-panels {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.analyze-chat-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: flex 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.analyze-chat-panel--wide {
    flex: 1;
}

.analyze-chat-panel--narrow {
    flex: 0 0 42%;
    border-right: 1px solid var(--border-subtle);
}

.analyze-preview-panel {
    display: flex;
    flex-direction: column;
    flex: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    background: var(--bg);
    position: relative;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: flex 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.analyze-preview-panel.visible {
    flex: 1;
    opacity: 1;
    transform: translateX(0);
    overflow-y: auto;
    padding: 20px;
    pointer-events: auto;
}

.analyze-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.analyze-preview-header h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 3px;
}

.analyze-preview-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.analyze-preview-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

.analyze-legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--yellow);
}

.analyze-preview-loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(14,15,19,0.65);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.analyze-preview-loading-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--yellow), #D4950A);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    animation: spinPulse 1.5s ease-in-out infinite;
}

.analyze-preview-loading span {
    font-size: 13px;
    color: var(--text-secondary);
}

.analyze-questions-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.analyze-questions-container.dimmed {
    opacity: 0.4;
}

/* ── Question Groups ── */
.analyze-question-group {
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card);
    overflow: hidden;
}

.analyze-group-header {
    padding: 9px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 8px;
}

.analyze-group-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yellow);
    flex-shrink: 0;
}

.analyze-group-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.analyze-group-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.analyze-group-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
.analyze-group-header:hover .analyze-group-delete-btn { opacity: 0.6; }
.analyze-group-delete-btn:hover { opacity: 1 !important; color: var(--red, #e74c3c); }

/* ── Question Items ── */
.analyze-question-item {
    padding: 9px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.analyze-question-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    margin: -4px -6px;
    transition: background 0.15s ease;
}

.analyze-question-row:hover {
    background: var(--surface-hover);
}

.analyze-question-num {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    text-align: right;
}

.analyze-question-text {
    flex: 1;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.analyze-question-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.analyze-question-edit-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.4;
    display: flex;
}

.analyze-question-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.analyze-question-row:hover .analyze-question-delete-btn { opacity: 0.5; }
.analyze-question-delete-btn:hover { opacity: 1 !important; color: var(--red, #e74c3c); }

/* ── Question Edit Mode ── */
.analyze-question-edit-mode {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.analyze-question-edit-mode textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--yellow);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 13px;
    resize: vertical;
    outline: none;
    line-height: 1.5;
    font-family: var(--font);
    box-sizing: border-box;
}

.analyze-question-edit-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.analyze-question-cancel-btn {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font);
}

.analyze-question-save-btn {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    border: none;
    background: var(--yellow);
    color: #1a1a1a;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font);
}

/* ── Gap Cards ── */
.analyze-gap-card {
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.analyze-gap-card:last-child {
    margin-bottom: 0;
}

.analyze-gap-card--expanded-high {
    border-color: var(--red-border);
    background: var(--red-bg);
}

.analyze-gap-card--expanded-low {
    border-color: var(--yellow-border);
    background: var(--yellow-bg);
}

.analyze-gap-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
}

.analyze-gap-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.analyze-gap-dot--high {
    background: var(--red);
}

.analyze-gap-dot--low {
    background: var(--yellow);
}

.analyze-gap-section {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.analyze-gap-description {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.4;
}

.analyze-gap-chevron {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 1px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.analyze-gap-chevron.expanded {
    transform: rotate(90deg);
}

.analyze-gap-details {
    padding: 0 12px 12px 29px;
    border-top: 1px solid var(--border-subtle);
}

.analyze-gap-detail-block {
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analyze-gap-detail-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.analyze-gap-detail-label--fix-high {
    color: var(--red);
}

.analyze-gap-detail-label--fix-low {
    color: var(--yellow);
}

.analyze-gap-detail-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ── Score Card ── */
.analyze-score-card {
    background: var(--surface);
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    margin-bottom: 14px;
}

.analyze-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.analyze-score-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analyze-score-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.analyze-score-value span {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.analyze-score-bar-track {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.analyze-score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.analyze-score-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Analyze Download Button (in chat) ── */
.analyze-download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    color: var(--yellow);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    width: 100%;
    margin-bottom: 10px;
    transition: all 0.15s ease;
}

.analyze-download-btn:hover {
    filter: brightness(1.1);
}

/* ── Analyze Hint Box ── */
.analyze-hint-box {
    font-size: 11.5px;
    color: var(--text-muted);
    padding: 8px 12px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.analyze-hint-box strong {
    color: var(--green);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .analyze-panels {
        flex-direction: column;
    }

    .analyze-chat-panel--narrow {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .analyze-preview-panel.visible {
        flex: 1;
        max-height: 50vh;
    }
}
