@font-face {
    font-family: 'HapoCustom';
    src: url('../fonts/custom.ttf') format('truetype');
    font-style: normal;
    font-display: swap;
}

/* Variables based on Hapo Charter */
:root {
    --primary-color: #ffd100;
    /* Yellow */
    --secondary-color: #000000;
    /* Black */
    --background-color: #ffffff;
    /* White */
    --text-color: #333333;
    --light-gray: #f4f4f4;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --font-family: 'HapoCustom', 'Inter', sans-serif;
    --bubble-feedback-gap: 2px;
    --feedback-btn-size: 16px;
    --feedback-icon-size: 10px;
    --feedback-pair-gap: 4px;
}

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

body {
    font-family: var(--font-family);
    background: transparent !important;
    /* Default for full page */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

/* Widget Button */
.widget-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    z-index: 1000;
}

.widget-btn:hover {
    transform: scale(1.1);
}

/* Modal Overlay */
.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chat-modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Chat Container */
.chat-container {
    width: 60vw;
    height: 90vh;
    max-height: 90vh;
    max-width: 60vw;
    background-color: var(--background-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(1);
    transition: transform 0.3s ease;
}

/* Full Page Mode */
.chat-container.full-page {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    max-width: 800px;
    height: 90vh;
    /* Fill most of screen */
    margin: 20px auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    /* Ensure it displays! */
    flex-direction: column;
}

.chat-modal-overlay.hidden .chat-container {
    transform: scale(0.9);
}

/* Header */
.chat-header {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    overflow: hidden;
}

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

.chat-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    /* White text on black header */
}

.status {
    font-size: 12px;
    color: var(--primary-color);
}

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

.header-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.18);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.language-selector {
    margin-right: 4px;
}

#lang-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
    min-width: 50px;
}

#lang-select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

#lang-select option {
    background: var(--secondary-color);
    color: white;
    padding: 10px;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #fafafa;
}

.message {
    max-width: 80%;
    width: fit-content;
    display: flex;
    flex-direction: column;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.message-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    max-width: 100%;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    margin-top: 3px;
    padding-left: 4px;
    font-size: 9px;
    line-height: 1;
    color: #9a9a9a;
    text-align: left;
}

.message.bot .message-main {
    order: 1;
}

.message.bot .message-time {
    order: 2;
}

.message.bot.has-feedback-actions .message-time {
    margin-top: calc(-1 * var(--feedback-btn-size) - 3px);
}

.message.bot .message-content {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-top-left-radius: 2px;
}

.message.user .message-content {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border-top-right-radius: 2px;
    font-weight: 500;
}

.quick-start-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.quick-start-persistent {
    margin: 0 0 6px;
    max-height: 72px;
    overflow-y: auto;
    padding-right: 2px;
}

.quick-start-persistent:empty {
    display: none;
}

.quick-start-bubble-btn {
    border: 1px solid var(--border-color);
    background: #fff;
    color: #222;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.quick-start-bubble-btn:hover {
    border-color: var(--primary-color);
    background-color: #fffdf0;
}

/* Image styling in messages */
.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.message-content img:hover {
    transform: scale(1.02);
    cursor: zoom-in;
}

/* Link styling in messages */
.message-content a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.2s;
}

.message-content a:hover {
    opacity: 0.8;
}

.message-assets {
    margin-top: 10px;
    border-top: 1px solid #ececec;
    padding-top: 8px;
}

.message-assets-title {
    font-size: 11px;
    font-weight: 600;
    color: #6f6f6f;
    margin: 6px 0 4px;
}

.message-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .message-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

.message-image-grid.single {
    grid-template-columns: 1fr;
}

.message-image-card {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: #f9f9f9; /* Light background for 'contain' fit */
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.message-image-card img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    display: block;
}

.message-image-grid.single .message-image-card img {
    max-height: 500px;
}

.message-pdf-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message-pdf-link {
    display: inline-block;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    background: #fffef7;
    font-size: 12px;
}

/* Code blocks */
.message-content pre {
    background: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message-content pre code {
    background: transparent;
    padding: 0;
}

/* Strong and emphasis */
.message-content strong {
    font-weight: 600;
    color: var(--secondary-color);
}

.message-content em {
    font-style: italic;
}

/* Tables */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
    background-color: var(--background-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    overflow: hidden;
}

.message-content table thead {
    background-color: #f4f4f4;
}

.message-content table th {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--secondary-color);
}

.message-content table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    color: var(--text-color);
}

.message-content table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.message-content table tbody tr:hover {
    background-color: #f0f0f0;
    transition: background-color 0.2s;
}

/* Input Area */
.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--background-color);
}

#chat-form {
    display: flex;
    gap: 8px;
}

#user-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#user-input:focus {
    border-color: var(--primary-color);
}

#send-btn {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#send-btn:hover {
    background-color: #333333;
}

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

.powered-by {
    text-align: center;
    font-size: 10px;
    color: #888;
    margin-top: 8px;
}

/* Toggle Switch */
.chat-options {
    padding: 5px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    /* Hide Stream toggle UI but keep its value in the DOM (#stream-mode-toggle). */
    display: none;
    justify-content: flex-end;
    align-items: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(14px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.label-text {
    font-size: 12px;
    color: #666;
    margin-right: 10px;
    vertical-align: middle;
}

/* Improved Loading Animation */
.message.bot.loading .message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 10px;
}

.dot {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #666;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .widget-btn {
        bottom: 20px;
        right: 20px;
    }

    .message {
        max-width: 90%;
    }
}

/* Status Indicator */
.status-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ccc;
}

.status-dot.active {
    background-color: #2ecc71;
    box-shadow: 0 0 4px #2ecc71;
}

.status-dot.inactive {
    background-color: #e74c3c;
}

.status-text {
    font-size: 11px;
    font-weight: 500;
}

/* Input Overlay */
.chat-input-area {
    position: relative;
}

.input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 12px 12px;
}

.input-overlay span {
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.input-overlay.hidden {
    display: none;
}

/* Message Actions (Copy & Rate) */
.message-actions {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    margin-top: 2px;
    opacity: 1;
    transition: opacity 0.2s;
    padding-left: 0;
    margin-left: 0;
    align-self: flex-end;
    flex-shrink: 0;
}

.message.bot .message-actions {
    opacity: 1;
}

.message.bot:hover .message-actions,
.message.user:hover .message-actions {
    opacity: 1;
}

/* Unified Button Style */
.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    font-family: inherit;
}

.action-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.action-btn svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Inline Feedback Container */
.feedback-inline-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    margin-top: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: 0;
    animation: fadeIn 0.3s ease;
    width: auto;
}

.feedback-inline-container.hidden {
    display: none;
}

.feedback-inline-container.feedback-complete {
    padding: 0;
    background: transparent;
    border: 0;
}

.feedback-choices {
    display: inline-flex;
    gap: var(--feedback-pair-gap);
    align-items: center;
}

.feedback-stars {
    display: flex;
    gap: 4px;
    cursor: pointer;
}

.feedback-star {
    font-size: 13px;
    /* Smaller size */
    color: transparent;
    /* Transparent body */
    -webkit-text-stroke: 1px #333;
    /* Black/Dark border */
    transition: all 0.2s;
}

.feedback-star:hover,
.feedback-star.active {
    color: #f1c40f;
    /* Gold fill */
    -webkit-text-stroke: 0px transparent;
    text-shadow: 0 0 1px #b7950b;
    /* Enhance visibility */
}

.feedback-status-text {
    font-size: 11px;
    color: #666;
    margin-left: 8px;
}

.feedback-status-text.success {
    color: #2ecc71;
}

.feedback-status-text.error {
    color: #e74c3c;
}

.feedback-choice-btn {
    width: var(--feedback-btn-size);
    height: var(--feedback-btn-size);
    min-width: var(--feedback-btn-size);
    min-height: var(--feedback-btn-size);
    border: 0;
    border-radius: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.feedback-choice-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.feedback-choice-btn:disabled {
    cursor: default;
    opacity: 0.65;
    transform: none;
}

.feedback-choice-btn:disabled:hover {
    opacity: 0.65;
    transform: none;
}

.feedback-choice-btn svg {
    width: var(--feedback-icon-size);
    height: var(--feedback-icon-size);
    display: block;
    fill: none !important;
    stroke: #111 !important;
    stroke-width: 1.9 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feedback-choice-btn svg * {
    stroke: #111 !important;
}

.low-rating-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: auto;
    min-width: 320px;
    max-width: 520px;
}

.low-rating-form.hidden {
    display: none;
}

.low-rating-label {
    font-size: 12px;
    color: #444;
}

.low-rating-remarks {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
    background: #fff;
}

.low-rating-remarks:focus {
    outline: none;
    border-color: #ffd100;
    box-shadow: 0 0 0 2px rgba(255, 209, 0, 0.2);
}

.low-rating-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.cancel-remarks-btn,
.send-remarks-btn {
    background-color: #ffd100;
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.cancel-remarks-btn:disabled,
.send-remarks-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cancel-remarks-btn:not(:disabled):hover,
.send-remarks-btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.cancel-remarks-btn {
    background-color: #f4f4f4;
    color: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* ============================================
   FEEDBACK SYSTEM STYLES
   ============================================ */

/* Feedback Section */
/* Feedback Section */
.feedback-section {
    margin-top: 10px;
    padding: 8px 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
    opacity: 1;
    /* Make always visible */
    transition: none;
}

/* Hover effect removed since it is now always visible */
.message.bot:hover .feedback-section {
    opacity: 1;
}

.feedback-prompt {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 400;
}

.feedback-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.feedback-btn {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
}

.feedback-btn:hover:not(:disabled) {
    background: #e3f2fd;
    border-color: #2196F3;
    transform: translateY(-1px);
}

.feedback-btn.thumbs-up:hover:not(:disabled) {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.feedback-btn.thumbs-down:hover:not(:disabled) {
    background: #ffebee;
    border-color: #f44336;
}

.feedback-btn.detailed:hover:not(:disabled) {
    background: #fff3e0;
    border-color: #ff9800;
}

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

.feedback-status {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 0;
}

.feedback-status.success {
    color: #4CAF50;
}

.feedback-status.error {
    color: #f44336;
}

/* Detailed Feedback Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--secondary-color);
    font-weight: 600;
}

/* Star Rating */
.star-rating {
    display: flex;
    gap: 8px;
    font-size: 40px;
    margin: 20px 0;
    justify-content: center;
}

.star {
    cursor: pointer;
    filter: grayscale(100%) brightness(1.5);
    transition: all 0.2s;
    user-select: none;
}

.star.selected {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.star:hover {
    filter: grayscale(0%) brightness(1.2);
    transform: scale(1.15);
}

/* Feedback Textarea */
#feedback-text {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s;
}

#feedback-text:focus {
    border-color: var(--primary-color);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.submit-btn,
.cancel-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    border: none;
}

.submit-btn {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.submit-btn:hover {
    background-color: #333;
    transform: translateY(-1px);
}

.cancel-btn {
    background-color: #f0f0f0;
    color: #666;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

/* Mobile Responsive Feedback */
@media (max-width: 480px) {
    .feedback-buttons {
        flex-direction: column;
    }

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

    .modal-content {
        padding: 24px 20px;
    }

    .star-rating {
        font-size: 32px;
        gap: 4px;
    }

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

    .submit-btn,
    .cancel-btn {
        width: 100%;
    }
}

/* =========================================================
   LEAD CAPTURE FORM (ZeroBounce Style: Name & Email before bubbles)
   ========================================================= */
.lead-capture-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 16px 18px;
    margin: 10px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    max-width: 420px;
    width: 100%;
    animation: leadFadeIn 0.3s ease-out;
    box-sizing: border-box;
    font-family: inherit;
}

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

.lead-card-header {
    margin-bottom: 12px;
}

.lead-card-header p {
    font-size: 13px;
    line-height: 1.4;
    color: #475569;
    margin: 0;
}

.lead-step {
    display: flex;
    flex-direction: column;
}

.lead-step.hidden {
    display: none;
}

.lead-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.lead-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background-color: #f8fafc;
    color: #0f172a;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    font-family: inherit;
}

.lead-input:focus {
    border-color: #ffd100;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 209, 0, 0.2);
}

.lead-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.lead-error-text {
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
    display: none;
}

.lead-error-text.show {
    display: block;
}

.lead-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 4px;
}

.lead-step-counter {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.lead-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lead-btn-next,
.lead-btn-submit {
    background-color: #ffd100;
    color: #1a1200;
    box-shadow: 0 2px 6px rgba(255, 209, 0, 0.35);
}

.lead-btn-next:hover,
.lead-btn-submit:hover {
    background-color: #e6bc00;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 209, 0, 0.4);
}

.lead-btn-next:active,
.lead-btn-submit:active {
    transform: translateY(0);
}

.lead-btn-prev {
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.lead-btn-prev:hover {
    background-color: #f1f5f9;
    color: #334155;
}

.lead-card-completed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fffde7;
    border: 1px solid #ffd100;
    border-radius: 12px;
    color: #7a5c00;
    font-size: 13px;
    font-weight: 500;
}

.lead-card-completed svg {
    flex-shrink: 0;
}

/* Skip link */
.lead-skip-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 6px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    font-family: inherit;
    transition: color 0.2s ease;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lead-skip-link:hover {
    color: #64748b;
}

/* Gated chat input state when lead required */
.chat-input-area.lead-gated #quick-start-persistent {
    display: none !important;
}

.chat-input-area.lead-gated #user-input {
    background-color: #f8fafc;
    cursor: not-allowed;
    opacity: 0.7;
}

.chat-input-area.lead-gated #send-btn {
    opacity: 0.4;
    cursor: not-allowed;
}

