/* even-invest style live chat panel — FAB buttons are unchanged (footer-1357.css) */

.live-chat-even {
    --lce-brand: #3b82f6;
    --lce-brand-dark: #2563eb;
    --lce-bg: #f9fafb;
    --lce-text: #111827;
    --lce-muted: #6b7280;
    --lce-border: #e5e7eb;
    pointer-events: none;
    z-index: 9999;
}

.live-chat-even.is-open {
    pointer-events: auto;
}

.live-chat-even__backdrop {
    display: none;
}

.live-chat-even__panel {
    position: fixed;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    color: var(--lce-text);
}

.live-chat-even.is-open .live-chat-even__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Mobile: fullscreen */
.live-chat-even__panel--mobile {
    inset: 0;
    z-index: 99999;
}

@media (min-width: 768px) {
    .live-chat-even__panel--mobile {
        display: none;
    }
}

/* Desktop: 420x600 bottom-right */
.live-chat-even__panel--desktop {
    display: none;
}

@media (min-width: 768px) {
    .live-chat-even__panel--desktop {
        display: flex;
        right: 24px;
        bottom: 24px;
        width: 420px;
        height: 600px;
        border-radius: 16px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        z-index: 9999;
    }
}

.live-chat-even__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(to right, #3b82f6, #2563eb);
    color: #fff;
    flex-shrink: 0;
}

.live-chat-even__header--desktop {
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
    padding: 16px 20px;
}

.live-chat-even__header-close,
.live-chat-even__header-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 0;
    background: transparent;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.live-chat-even__header-close:hover,
.live-chat-even__header-x:hover {
    background: rgba(255, 255, 255, 0.2);
}

.live-chat-even__header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.live-chat-even__header-sub {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.live-chat-even__body {
    flex: 1;
    min-height: 0;
    background: var(--lce-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-chat-even__panel--desktop .live-chat-even__body {
    border-radius: 0 0 16px 16px;
}

/* List screen */
.lce-list {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lce-list__scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lce-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--lce-muted);
}

.lce-list__empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.lce-list__empty-title {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 4px;
}

.lce-list__empty-sub {
    font-size: 13px;
    margin: 0;
}

.lce-room-item {
    display: block;
    width: 100%;
    padding: 16px;
    border: 0;
    border-bottom: 1px solid var(--lce-border);
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.lce-room-item:hover {
    background: #f3f4f6;
}

.lce-room-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.lce-room-item__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--lce-text);
    margin: 0;
    flex: 1;
}

.lce-room-item__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--lce-muted);
}

.lce-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    white-space: nowrap;
}

.lce-badge--waiting {
    background: #fef3c7;
    color: #b45309;
}

.lce-badge--active {
    background: #dcfce7;
    color: #15803d;
}

.lce-badge--closed {
    background: #f3f4f6;
    color: #6b7280;
}

.lce-list__footer {
    padding: 16px;
    border-top: 1px solid var(--lce-border);
    background: #fff;
    flex-shrink: 0;
}

.lce-btn-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    background: var(--lce-brand);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
    transition: background 0.2s;
}

.lce-btn-new:hover {
    background: var(--lce-brand-dark);
}

/* New inquiry */
.lce-new {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lce-subheader {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--lce-border);
    background: #fff;
    flex-shrink: 0;
}

.lce-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin-right: 12px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #374151;
}

.lce-back:hover {
    background: #f3f4f6;
}

.lce-subheader__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.lce-form {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.lce-field {
    margin-bottom: 24px;
}

.lce-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.lce-field input,
.lce-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--lce-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.lce-field input:focus,
.lce-field textarea:focus {
    outline: none;
    border-color: var(--lce-brand);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.lce-field textarea {
    min-height: 120px;
}

.lce-btn-primary {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: var(--lce-brand);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.lce-btn-primary:hover {
    background: var(--lce-brand-dark);
}

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

/* Chat room */
.lce-room {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lce-room__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--lce-border);
    background: #fff;
    flex-shrink: 0;
}

.lce-room__header-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.lce-room__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lce-room__status {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--lce-muted);
}

.lce-room__status--closed {
    color: #ef4444;
    font-weight: 500;
}

.lce-btn-close-room {
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #dc2626;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

.lce-btn-close-room:hover {
    background: #fef2f2;
}

.lce-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

.lce-messages__loading,
.lce-messages__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 128px;
    color: var(--lce-muted);
    font-size: 14px;
    gap: 8px;
}

.lce-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--lce-brand);
    border-radius: 50%;
    animation: lce-spin 0.8s linear infinite;
}

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

.lce-msg-row {
    display: flex;
    margin-bottom: 16px;
}

.lce-msg-row--user {
    justify-content: flex-end;
}

.lce-msg-row--admin {
    justify-content: flex-start;
}

.lce-msg-row--system {
    justify-content: center;
    margin: 16px 0;
}

.lce-msg-system {
    padding: 6px 12px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    font-size: 12px;
    color: #2563eb;
}

.lce-msg-wrap {
    max-width: 70%;
}

.lce-msg-sender {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--lce-muted);
}

.lce-msg-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lce-brand);
    font-size: 10px;
}

.lce-bubble {
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.lce-bubble--user {
    background: var(--lce-brand);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.lce-bubble--admin {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.lce-bubble img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    display: block;
}

.lce-msg-time {
    margin-top: 4px;
    font-size: 11px;
    color: #9ca3af;
}

.lce-msg-time--user {
    text-align: right;
}

.lce-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--lce-border);
    background: #fff;
    flex-shrink: 0;
}

.lce-input-bar input[type="file"] {
    display: none;
}

.lce-btn-attach,
.lce-btn-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.lce-btn-attach {
    background: #f3f4f6;
    color: #6b7280;
}

.lce-btn-attach:hover {
    background: #e5e7eb;
}

.lce-btn-send {
    background: var(--lce-brand);
    color: #fff;
}

.lce-btn-send:hover {
    background: var(--lce-brand-dark);
}

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

.lce-input-bar textarea {
    flex: 1;
    min-height: 40px;
    max-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--lce-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    line-height: 1.4;
}

.lce-input-bar textarea:focus {
    outline: none;
    border-color: var(--lce-brand);
}

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