.lc-container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: var(--bg-color, #1a1a2e);
    color: var(--text-color, #e0e0e0);
    font-family: inherit;
}
.lc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--header-bg, #16213e);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.lc-header-left { display: flex; align-items: center; gap: 10px; }
.lc-header-left h2 { margin: 0; font-size: 16px; font-weight: 600; }
.lc-header-right { display: flex; align-items: center; gap: 6px; }
.lc-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.lc-badge-slow    { background: rgba(239,68,68,0.2);  color: #f87171; border: 1px solid rgba(239,68,68,0.4); }
.lc-badge-moderate{ background: rgba(245,158,11,0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.4); }
.lc-badge-fast    { background: rgba(16,185,129,0.2); color: #34d399; border: 1px solid rgba(16,185,129,0.4); }
.lc-badge-unknown { background: rgba(107,114,128,0.2);color: #9ca3af; border: 1px solid rgba(107,114,128,0.4); }
.lc-fullchat-btn, .lc-logout-btn {
    min-height: 36px;
}
.lc-fullchat-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px;
    background: var(--primary-color, #0052CC);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.lc-fullchat-btn:hover { opacity: 0.85; }
.lc-logout-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px;
    background: rgba(239,68,68,0.15);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.lc-logout-btn:hover { opacity: 0.85; background: rgba(239,68,68,0.25); }
.lc-error-banner {
    padding: 8px 16px;
    background: rgba(239,68,68,0.1);
    border-bottom: 1px solid rgba(239,68,68,0.2);
    font-size: 12px;
    color: #f87171;
    flex-shrink: 0;
}
.lc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lc-message { display: flex; flex-direction: column; max-width: 78%; }
.lc-mine { align-self: flex-end; align-items: flex-end; }
.lc-theirs { align-self: flex-start; align-items: flex-start; }
.lc-msg-sender { font-size: 11px; color: var(--primary-color, #4d8af0); margin-bottom: 2px; font-weight: 600; }
.lc-msg-bubble {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
}
.lc-mine .lc-msg-bubble { background: var(--primary-color, #0052CC); color: white; border-bottom-right-radius: 4px; }
.lc-theirs .lc-msg-bubble { background: var(--input-bg, #2a2a4a); border-bottom-left-radius: 4px; }
.lc-msg-time { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.lc-media-placeholder { font-style: italic; font-size: 12px; opacity: 0.7; }
.lc-empty { text-align: center; color: rgba(255,255,255,0.3); font-size: 13px; margin-top: 40px; }
.lc-status-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 16px;
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    background: var(--header-bg, #16213e);
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.lc-input-area {
    display: flex; gap: 8px; align-items: flex-end;
    padding: 10px 12px;
    background: var(--header-bg, #16213e);
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.lc-textarea {
    flex: 1;
    background: var(--input-bg, #2a2a4a);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--text-color, #e0e0e0);
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
}
.lc-textarea:focus { border-color: var(--primary-color, #0052CC); }
.lc-send-btn {
    width: 40px; height: 40px;
    background: var(--primary-color, #0052CC);
    border: none; border-radius: 10px;
    color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.lc-send-btn:disabled { opacity: 0.45; cursor: default; }
.lc-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100dvh; gap: 16px;
    color: rgba(255,255,255,0.5); font-size: 14px;
    background: var(--bg-color, #1a1a2e);
}
.lc-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-color, #0052CC);
    border-radius: 50%;
    animation: lc-spin 0.8s linear infinite;
}
.lc-spinner-sm {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: lc-spin 0.8s linear infinite;
    display: inline-block;
}
.lc-fetching-dot {
    width: 6px; height: 6px;
    background: var(--primary-color, #0052CC);
    border-radius: 50%;
    animation: lc-pulse 1s ease-in-out infinite;
    display: inline-block;
}
@keyframes lc-spin { to { transform: rotate(360deg); } }
@keyframes lc-pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* iOS / Safari touch fixes */
.lc-messages {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.lc-textarea {
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}
.lc-fullchat-btn, .lc-send-btn, .lc-logout-btn {
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}
/* Prevent iOS Safari from zooming on focus */
@supports (-webkit-touch-callout: none) {
    .lc-textarea { font-size: 16px !important; }
}
/* Safe-area insets: notch / Dynamic Island / home indicator */
@supports (padding: max(0px)) {
    .lc-header {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    .lc-input-area {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}
