
	/* chat.html specific styles */

	/* Sidebar */
	.sidebar {
	    width: 260px;
	    background-color: #f7f7f8;
	    color: #111;
	    display: flex;
	    flex-direction: column;
	    border-right: 1px solid #e5e7eb;
	    transition: transform 0.3s ease;
	    flex-shrink: 0; /* Sidebar should not shrink horizontally */
	    height: 100%; /* Fill height of page-content-wrapper */
	    position: relative; /* For desktop, ensure it's in flow */
	}

	.sidebar-header {
	    padding: 16px;
	    border-bottom: 1px solid #e5e7eb;
	    display: flex;
	    flex-direction: column;
	    align-items: stretch;
	    gap: 10px;
	    flex-shrink: 0;
	}

	.sidebar-action-btn {
	    width: 100%;
	    padding: 10px 12px;
	    background-color: transparent;
	    border: 1px solid #e5e7eb;
	    color: #374151;
	    border-radius: 6px;
	    cursor: pointer;
	    font-size: 14px;
	    display: flex;
	    align-items: center;
	    justify-content: center;
	    gap: 8px;
	    transition: background-color 0.2s;
	}
	.sidebar-action-btn:hover {
	    background-color: #e9e9ec;
	}
	.sidebar-action-btn:disabled {
	    opacity: 0.5;
	    cursor: not-allowed;
	}
	.sidebar-action-btn svg {
	    flex-shrink: 0;
	}

	.chat-history {
	    flex: 1; /* Grow to fill available space in sidebar */
	    overflow-y: auto; /* Allow history to scroll */
	    color: #8e8ea0;
	    font-size: 14px;
	    min-height: 0; /* Allow shrinking */
	}
	.chat-history-list {
	    list-style: none;
	    padding: 0;
	    margin: 0;
	}
	.chat-history-item {
	    padding: 10px 16px;
	    cursor: pointer;
	    border-bottom: 1px solid #e5e7eb;
	    font-size: 13px;
	    white-space: nowrap;
	    overflow: hidden;
	    text-overflow: ellipsis;
	    color: #374151;
	    transition: background-color 0.2s, color 0.2s;
	    display: flex;
	    justify-content: space-between;
	    align-items: center;
	}
	.chat-history-item:last-child {
	    border-bottom: none;
	}
	.chat-history-item:hover {
	    background-color: #f0f0f3;
	    color: #111;
	}
	.chat-history-item.active {
	    background-color: #0078D4;
	    color: white;
	    font-weight: 500;
	}
	.chat-history-item-title {
	    flex-grow: 1;
	    white-space: nowrap;
	    overflow: hidden;
	    text-overflow: ellipsis;
	    margin-right: 8px;
	}
	.chat-share-icon {
	    font-size: 12px;
	    opacity: 0.7;
	    cursor: pointer;
	    flex-shrink: 0;
	}
	.chat-share-icon:hover {
	    opacity: 1;
	}
	.chat-history-item .item-menu-btn {
	    display: none;
	    background: none;
	    border: none;
	    cursor: pointer;
	    color: #6b7280;
	    padding: 2px 4px;
	    border-radius: 4px;
	    font-size: 16px;
	    line-height: 1;
	    flex-shrink: 0;
	    margin-left: 4px;
	}
	.chat-history-item:hover .item-menu-btn,
	.chat-history-item.active .item-menu-btn {
	    display: flex;
	    align-items: center;
	}
	.chat-history-item.active .item-menu-btn {
	    color: rgba(255,255,255,0.8);
	}
	.chat-history-item.active .item-menu-btn:hover {
	    color: white;
	    background: rgba(255,255,255,0.15);
	}
	.chat-history-item .item-menu-btn:hover {
	    color: #111;
	    background: rgba(0,0,0,0.07);
	}
	.chat-item-dropdown {
	    position: fixed;
	    background: #fff;
	    border: 1px solid #e5e7eb;
	    border-radius: 10px;
	    z-index: 9999;
	    min-width: 160px;
	    padding: 4px 0;
	    overflow: hidden;
	}
	.chat-item-dropdown button {
	    display: flex;
	    align-items: center;
	    gap: 8px;
	    width: 100%;
	    padding: 9px 14px;
	    background: none;
	    border: none;
	    cursor: pointer;
	    font-size: 13px;
	    color: #374151;
	    text-align: left;
	}
	.chat-item-dropdown button:hover { background: #f3f4f6; }
	.chat-item-dropdown button.danger { color: #dc2626; }
	.chat-item-dropdown button.danger:hover { background: #fef2f2; }
	.cid-confirm { padding: 10px 14px 8px; }
	.cid-confirm p { font-size: 12px; color: #374151; margin: 0 0 8px; font-weight: 500; }
	.cid-confirm-btns { display: flex; gap: 6px; }
	.cid-confirm-btns button { flex: 1; padding: 6px 4px; font-size: 12px; border-radius: 6px; border: 1px solid #e5e7eb; cursor: pointer; font-weight: 600; }
	.cid-cancel-btn { background: #f9fafb; color: #374151; }
	.cid-cancel-btn:hover { background: #f3f4f6 !important; }
	.cid-confirm-del-btn { background: #dc2626 !important; color: white !important; border-color: #dc2626 !important; }
	.cid-confirm-del-btn:hover { background: #b91c1c !important; }
	.no-history-message {
	    padding: 20px 16px;
	    text-align: center;
	    display: flex;
	    align-items: center;
	    justify-content: center;
	    height: 100%;
	    font-size: 13px;
	    color: #8e8ea0;
	}

	.sidebar-bottom {
	    padding: 16px;
	    border-top: 1px solid #e5e7eb;
	    flex-shrink: 0;
	    overflow-y: auto; /* Allow bottom section to scroll if model list is too long */
	    /*max-height: 40%; /* Example: constrain height if needed */
	}

	/* Main Content Area */
	.main-content {
	    flex: 1; /* Grow to fill remaining horizontal space */
	    display: flex;
	    flex-direction: column; /* Stack header, chat-container, input-area */
	    background-color: white;
	    height: 100%; /* Fill height of page-content-wrapper */
	    overflow: hidden; /* Main content itself should not scroll */
	    min-width: 0; /* Allow shrinking */
	}

	/* Headers within Main Content (Desktop and Mobile) */
	.chat-header,
	.mobile-header {
	    flex-shrink: 0; /* Headers should not shrink vertically */
	    /* Common styles for both if any, otherwise keep separate */
	}

	.mobile-header {
	    display: none; /* Shown via media query */
	    padding: 16px;
	    background-color: white;
	    border-bottom: 1px solid #e5e5e5;
	    align-items: center;
	    gap: 12px;
	    position: relative; /* For z-index if needed, though not strictly here */
	    z-index: 998; /* Below main banner, above chat content if overlapping */
	}
	.mobile-header-left {
	    display: flex;
	    align-items: center;
	    gap: 8px;
	    flex-grow: 1;
	}
	.mobile-header-right {
	    display: flex;
	    align-items: center;
	    flex-shrink: 0;
	}
	.mobile-sidebar-btn {
	    background: none;
	    border: none;
	    font-size: 20px;
	    cursor: pointer;
	    padding: 4px;
	    color: #374151;
	    display: flex;
	    align-items: center;
	    justify-content: center;
	}
	.mobile-sidebar-btn svg {
	    width: 22px;
	    height: 22px;
	    pointer-events: none;
	}

	.chat-header { /* Desktop Header */
	    padding: 0 20px;
	    border-bottom: 1px solid #e5e5e5;
	    background-color: white;
	    display: flex;
	    align-items: center;
	    justify-content: space-between;
	    height: 60px; /* Fixed height */
	}
	.chat-header > *:nth-child(1) { flex-shrink: 0; } /* Spacer or logo */

	.model-selector-container {
	    flex-grow: 1;
	    display: flex;
	    justify-content: center;
	}
	.mobile-model-selector-container { /* Already covered by .model-selector-container generally */
	    flex-grow: 1;
	    display: flex;
	    justify-content: center;
	}
	.model-selector {
	    font-size: 14px;
	    color: #6e6e80;
	    display: flex;
	    align-items: center;
	    gap: 4px;
	    cursor: pointer;
	    padding: 8px 12px;
	    border-radius: 6px;
	    transition: background-color 0.2s;
	    position: relative; /* For dropdown positioning */
	}
	.model-selector:hover { background-color: #f3f4f6; }
	.model-arrow-icon { line-height: 1; position: relative; top: -3px; }

	.model-dropdown {
	    position: absolute;
	    top: 100%;
	    left: 50%;
	    transform: translateX(-50%);
	    background: white;
	    border: 1px solid #e5e5e5;
	    border-radius: 12px;
	    min-width: 220px;
	    z-index: 1000; /* Above other content */
	    display: none;
	    margin-top: 8px;
	    overflow: hidden;
	}
	.model-dropdown.show { display: block; }

	.model-group-header {
	    padding: 8px 16px 4px 16px;
	    font-size: 12px;
	    font-weight: 600;
	    color: #6b7280;
	    text-transform: uppercase;
	    letter-spacing: 0.05em;
	    background-color: #f9fafb;
	    border-bottom: 1px solid #e5e5e5;
	}
	.model-option {
	    text-decoration: none;
	    color: #374151; /* Default text color for options */
	    padding: 10px 16px;
	    cursor: pointer;
	    transition: background-color 0.2s;
	    border-bottom: 1px solid #f3f4f6;
	    display: flex;
	    align-items: center;
	    justify-content: space-between;
	}
	.model-option:last-child { border-bottom: none; }
	.model-option:hover:not(.disabled) { background-color: #f0f0f0; } /* Lighter hover */
	.model-option.active { background-color: #10a37f; color: white; }
	.model-option.active:hover { background-color: #0d8c6a; }
	.model-option.disabled { color: #9ca3af; cursor: not-allowed; opacity: 0.6; }
	.model-name { font-size: 14px; font-weight: 500; }
	.model-status {
	    font-size: 11px;
	    color: #6b7280;
	    background-color: #e9ecef;
	    padding: 2px 6px;
	    border-radius: 10px;
	    margin-left: 8px;
	}
	.model-option.active .model-status {
	    background-color: rgba(255, 255, 255, 0.2);
	    color: rgba(255, 255, 255, 0.8);
	}

	/* Chat Container (holds welcome message or messages) */
	.chat-container { /* ID: chatInterfaceContainer */
	    flex: 1; /* THIS IS KEY: Grow to fill vertical space in .main-content */
	    display: flex;
	    flex-direction: column; /* Stack welcome OR messages */
	    overflow: hidden; /* Crucial: This container itself should not scroll */
	    min-height: 0; /* Allow shrinking if content is small */
	    /* Padding removed from here, applied to children if needed */
	}
	.chat-container.has-messages {
	    justify-content: flex-start; /* Align messages to top */
	}
	.chat-container.has-messages .welcome-message {
	    display: none;
	}

	.welcome-message {
	    text-align: center;
	    max-width: 600px;
	    margin: auto; /* Vertically and horizontally center when it's the only child */
	    padding: 20px; /* Space around the welcome text */
	}
	.welcome-title {
	    font-size: 32px;
	    color: #202123;
	    margin-bottom: 20px;
	    font-weight: 600;
	}
	.welcome-subtitle {
	    font-size: 16px;
	    color: #6e6e80;
	    margin-bottom: 30px;
	}

	/* Messages Container (Scrollable) */
	.messages-container {
	    flex: 1; /* Grow to fill .chat-container */
	    overflow-y: auto; /* THIS IS WHERE MESSAGES SCROLL */
	    padding: 20px;   /* Padding for message content area */
	    max-width: 768px;
	    width: 100%;
	    margin: 0 auto; /* Center messages within their container */
	    min-height: 0; /* Allow shrinking */
	}
	.messages-container.hidden { display: none !important; }

	.message {
	    margin-bottom: 24px;
	    display: flex;
	    gap: 16px;
	}
	.message-avatar {
	    width: 32px;
	    height: 32px;
	    border-radius: 4px;
	    display: flex;
	    align-items: center;
	    justify-content: center;
	    font-size: 12px;
	    font-weight: bold;
	    color: white;
	    flex-shrink: 0;
	}
	.user-message .message-avatar { background-color: #10a37f; }
	.assistant-message .message-avatar { background-color: #2196F3; }
	.message-content {
	    flex: 1;
	    font-size: 16px;
	    line-height: 1.6;
	    color: #374151;
	    padding-top: 6px;
	    word-wrap: break-word; /* Ensure long words break */
	    overflow-wrap: break-word; /* Ensure long words break */
	}
	.message-content p { margin-bottom: 0.5em; }
	.message-content p:last-child { margin-bottom: 0; }
	.message-content ul, .message-content ol { margin-left: 20px; margin-bottom: 0.5em; padding-left: 1.2em; }
	.message-content li { margin-bottom: 0.25em; }
	.message-content pre { background-color: #f0f0f0; padding: 10px; border-radius: 5px; overflow-x: auto; font-family: 'Courier New', Courier, monospace; margin-top: 0.5em; margin-bottom: 0.5em; }
	.message-content code:not(pre code) { background-color: #e0e0e0; padding: 2px 4px; border-radius: 3px; font-family: 'Courier New', Courier, monospace; }

	/* Input Area */
	.input-area {
	    flex-shrink: 0; /* Input area should not shrink vertically */
	    padding: 20px;
	    background-color: white;
	    border-top: 1px solid #e5e5e5;
	}
	.input-container {
	    max-width: 768px;
	    margin: 0 auto;
	    position: relative;
	}
	.input-box {
	    width: 100%;
	    padding: 16px 50px 16px 16px;
	    border: 1px solid #d1d5db;
	    border-radius: 12px;
	    font-size: 16px;
	    outline: none;
	    resize: none;
	    min-height: 52px;
	    max-height: 200px; /* Max height before internal scrollbar appears */
	    background-color: white;
	    font-family: inherit;
	    overflow-y: hidden; /* Changed from hidden to auto for textarea's own scroll */
	}
	.input-box:focus {
	    border-color: #10a37f;
	}
	.send-button {
	    position: absolute;
	    right: 8px;
	    top: 50%;
	    transform: translateY(-50%);
	    width: 36px;
	    height: 36px;
	    background-color: #10a37f;
	    border: none;
	    border-radius: 8px;
	    color: white;
	    cursor: pointer;
	    display: flex;
	    align-items: center;
	    justify-content: center;
	    opacity: 0.5;
	    transition: opacity 0.2s;
	}
	.send-button:hover { opacity: 1; }
	.send-button.active { opacity: 1; }


	/* Mobile Specific Adjustments */
	@media (max-width: 768px) {
	    .sidebar {
	        position: fixed;
	        left: -260px;              /* Start off-screen */
	        top: 60px;                 /* Below the main banner */
	        bottom: 0;                 /* ADD THIS - Fill remaining vertical space */
	        width: 260px;              /* Explicit width */
	        /* height: calc(100vh - 60px); REMOVE THIS */
	        z-index: 1001;
	        background-color: #f7f7f8; /* Added for clarity, was in main .sidebar rule */
	        color: #111;              /* Added for clarity */
	        display: flex;             /* Added for clarity, was in main .sidebar rule */
	        flex-direction: column;    /* Added for clarity, was in main .sidebar rule */
	        border-right: 1px solid #e5e7eb; /* Added for clarity */
	        transition: transform 0.3s ease; /* Added for clarity */
	        overflow: hidden;          /* CRUCIAL: Prevents the sidebar panel itself from scrolling or growing */
	    }
	    .sidebar.open {
	        transform: translateX(260px);
	    }

	    .main-content {
	        width: 100%; /* On mobile, main-content takes full width of page-content-wrapper */
	    }

	    .mobile-header { display: flex; }
	    .chat-header { display: none; } /* Hide desktop header */

	    .welcome-title { font-size: 24px; }
	    .welcome-message { padding: 0 16px; /* Adjust padding for smaller screens */ }

	    .input-area { padding: 16px; }
	    .messages-container { padding: 16px; }
	    .message { gap: 12px; }
	    .message-avatar { width: 28px; height: 28px; font-size: 11px; }
	}

	/* Overlay for mobile sidebar */
	.overlay {
	    display: none;
	    position: fixed;
	    top: 60px; /* Start below the main banner */
	    left: 0;
	    right: 0;
	    bottom: 0;
	    background-color: rgba(0, 0, 0, 0.5);
	    z-index: 1000; /* Below sidebar, above page content */
	}
	.overlay.show { display: block; }


	/* Share Modal Styles */
	.share-modal-overlay {
	    position: fixed;
	    top: 0;
	    left: 0;
	    width: 100%;
	    height: 100%;
	    background: rgba(0, 0, 0, 0.6);
	    backdrop-filter: blur(5px);
	    display: flex; /* changed from none for open/close logic */
	    justify-content: center;
	    align-items: center;
	    z-index: 1050; /* High z-index */
	    opacity: 0;
	    visibility: hidden;
	    transition: opacity 0.3s ease, visibility 0s 0.3s linear;
	}
	.share-modal-overlay.show {
	    opacity: 1;
	    visibility: visible;
	    transition: opacity 0.3s ease, visibility 0s 0s linear;
	}
	.share-modal-content {
	    background: white;
	    border-radius: 20px;
	    padding: 30px;
	    width: 90%;
	    max-width: 480px;
	    max-height: 90vh;
	    overflow-y: auto;
	    position: relative;
	    transform: translateY(20px) scale(0.95);
	    transition: transform 0.3s ease;
	}
	.share-modal-overlay.show .share-modal-content {
	    transform: translateY(0) scale(1);
	}
	.share-modal-close {
	    position: absolute;
	    top: 15px;
	    right: 15px;
	    background: none;
	    border: none;
	    font-size: 24px;
	    cursor: pointer;
	    color: #666;
	    width: 40px;
	    height: 40px;
	    border-radius: 50%;
	    display: flex;
	    align-items: center;
	    justify-content: center;
	    transition: all 0.2s ease;
	}
	.share-modal-close:hover { background: #f5f5f5; color: #333; }
	.share-modal-content h2 { color: #333; margin-bottom: 8px; font-size: 24px; font-weight: 600; }
	.share-modal-content > p { color: #666; margin-bottom: 25px; font-size: 14px; line-height: 1.5; }
	.share-link-container { background: #f8f9fa; border-radius: 12px; padding: 20px; margin-bottom: 25px; border: 1px solid #e9ecef; }
	.share-link-container label { display: block; color: #495057; font-weight: 500; margin-bottom: 8px; font-size: 14px; }
	.share-link-input-group { display: flex; gap: 10px; }
	#shareLinkInput { flex: 1; padding: 12px 15px; border: 1px solid #dee2e6; border-radius: 8px; font-size: 14px; background: white; color: #495057; }
	#shareLinkInput:focus { outline: none; border-color: #667eea; }
	#copyShareLinkButton { background: #667eea; color: white; border: none; padding: 12px 20px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 8px; transition: all 0.2s ease; white-space: nowrap; }
	#copyShareLinkButton:hover { background: #5a6fd8; transform: translateY(-1px); }
	#copyShareLinkButton.share-copied { background: #28a745; }
	.share-social-buttons p { color: #495057; font-weight: 500; margin-bottom: 15px; font-size: 14px; }
	.share-social-buttons-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
	.social-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: 14px; transition: all 0.2s ease; color: white !important; } /* Added !important for color override */
	.social-btn:hover { transform: translateY(-2px); }
	.social-btn.facebook { background: #1877f2; }
	.social-btn.twitter { background: #1da1f2; }
	.social-btn.linkedin { background: #0077b5; }
	.social-btn.reddit { background: #ff4500; }
	.social-btn.email { background: #34495e; }
	.social-btn.whatsapp { background: #25d366; }
	.social-btn.telegram { background: #0088cc; }
	.share-error-message, .share-status-message { margin-top: 15px; padding: 10px 15px; border-radius: 8px; font-size: 14px; display: none; }
	.share-error-message { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
	.share-status-message { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

	@media (max-width: 480px) {
	    .share-modal-content { padding: 20px; margin: 10px; }
	    .share-link-input-group { flex-direction: column; }
	    .share-social-buttons-grid { grid-template-columns: 1fr; }
	}
	
	
	
	/* --- CUSTOM HTML SIDEBAR BOTTOM ---*/
	
	.profession-custom-html-content {
	    max-height: 150px; /* Or whatever max height you want before scrolling starts */
	    overflow-y: auto;  /* Enable vertical scrolling when content exceeds max-height */
	    padding-right: 5px; /* Add some padding so content doesn't touch the scrollbar */
	    margin-bottom: 5px; /* Add some space below the custom content */
	    color: #374151; /* Adjusted for light sidebar background */
	    font-size: 0.875rem; /* Slightly smaller font size for disclaimers, adjust as needed */
	    line-height: 1.5;
	    border-radius: 8px;       /* Rounded corners */
	    padding: 5px;            /* Padding inside the box */
	    border: 0px solid #444;   /* Subtle border */
	}

	/* --- Styling for WebKit browsers (Chrome, Safari, newer Edge, Opera) --- */
	.profession-custom-html-content::-webkit-scrollbar {
	    width: 8px; /* Width of the vertical scrollbar */
	}

	.profession-custom-html-content::-webkit-scrollbar-track {
	    background: #3f3f44; /* Background of the scrollbar track, slightly lighter than thumb bg */
	    border-radius: 10px; /* Rounded track */
	}

	.profession-custom-html-content::-webkit-scrollbar-thumb {
	    background-color: #6b6b72; /* Color of the scrollbar thumb */
	    border-radius: 10px; /* Rounded scrollbar thumb */
	    border: 2px solid #3f3f44; /* Creates padding around thumb, same color as track */
	}

	.profession-custom-html-content::-webkit-scrollbar-thumb:hover {
	    background-color: #85858d; /* Color of the scrollbar thumb on hover */
	}
	

.tool-guidance { text-align: left; margin-top: 24px; padding-top: 16px; border-top: 1px solid #e5e7eb; font-size: 14px; line-height: 1.65; color: #374151; }
.tool-guidance h2 { font-size: 18px; line-height: 1.35; margin: 0 0 10px; }
.tool-guidance h3 { font-size: 15px; margin: 18px 0 8px; }
.tool-guidance summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.tool-guidance blockquote { margin: 12px 0; padding: 12px; border-left: 3px solid #7c3aed; background: #f5f3ff; overflow-wrap: anywhere; }
.tool-guidance a { color: #5b21b6; text-decoration: underline; }
.input-area { flex-shrink: 0; }
