* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: 
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background:   
        linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)),
        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Auth Screen Styles */
.auth-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 8px;
}

.auth-header p {
    color: #666;
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #f0f0f0;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-button {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-button:hover {
    background: #5568d3;
}

.auth-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.error-message.show {
    display: block;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #999;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.divider span {
    padding: 0 16px;
}

.google-button {
    width: 100%;
    padding: 12px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
}

.google-button:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

/* App Container (hidden until authenticated) */
.app-container {
    display: none;
    width: 100%;
    /* max-width: 1400px; */
    height: 90vh;
    gap: 20px;
}

.app-container.show {
    display: flex;
}

/* User Menu */

.user-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-email {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    min-width: 0;
}

.user-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 105px;
    right: 38px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
}

.user-dropdown a {
    text-decoration: none;
    display: block;
    width: 100%;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    padding: 12px 16px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: #f8f9fa;
}

.user-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
    color: #ff4757;
}

.lexicon-panel {
    width: 350px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.chat-panel {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h1 {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 20px;
}

h2 {
    font-size: 18px;
    color: #667eea;
    margin-bottom: 16px;
}

.lexicon-switcher {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.lexicon-header {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

#lexiconSelect {
    flex: 1;
    padding: 10px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    background: white;
    cursor: pointer;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.chats-header {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.chat-switcher {
    margin-bottom: 20px;
    padding-bottom: 20px;
    background: white;
    border-bottom: 2px solid #e0e0e0;
}

#chatSelect {
    flex: 1;
    padding: 10px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    background: white;
    cursor: pointer;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

#lexiconSelect,
#chatSelect {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%667eea' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 18px;
    color: #667eea;
    flex: 1;
    min-width: 0;
 }

.new-chat-btn {
    width: 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.new-chat-btn:hover {
    background: #5568d3;
}

.new-lexicon-btn {
    width: 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.new-lexicon-btn:hover {
    background: #5568d3;
}

.add-word-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group textarea {
    padding: 10px;
    border: 1px solid #667eea;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.input-group textarea {
    resize: vertical;
    min-height: 60px;
}

.add-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #5568d3;
}

.bulk-import-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.toggle-bulk-btn {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.toggle-bulk-btn:hover {
    background: #667eea;
    color: white;
}

.bulk-import-form {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#bulkInput {
    min-height: 150px;
    font-family: monospace;
    font-size: 13px;
}

.lexicon-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lexicon-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    position: relative;
}

.lexicon-item .word {
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
    font-size: 15px;
}

.lexicon-item .definition {
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
}

.lexicon-item .example {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4757;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: #e84041;
}

.delete {
    width: 40px;
    background: transparent;
    font-size: 26px;
    font-weight: 500;
    color: #df2240;
    border: 2px solid #df2240;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.delete:hover {
    color: white;
    background: #df2240;

}

.chat-header {
    background: #667eea;
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    /* justify-content: space-between; */
}

.chat-header h1, .privacy-header h1 {
    color: white;
    margin: 0;
}

.dark-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dark-toggle {
    background: rgba(255,255,255,0.2);
    border: 1px solid white;
    color: white;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.lexicon-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    margin-left: auto;
    margin-right: 10px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 4rem clamp(1rem, 6vw, 8rem);
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 auto;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

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

/* Avatars Not Beings Used */

/* .message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
} */

/* .message.user .message-avatar {
    background: #667eea;
    color: white;
}

.message.bot .message-avatar {
    background: #f0f0f0;
    color: #667eea;
} */

.message-content {
    background: #edf0f2;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1.125rem;
    line-height: 1.6;
}

.message.user .message-content {
    background: #667eea;
    color: white;
}

.input-area {
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
}

.input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 1rem;
    font-family: inherit;
}

.input-area input:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #5568d3;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
}

.cancel-btn {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    border: 2px solid #df2240;

}

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

.lexicon-limit-note {
    margin-top: 12px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    color: white;
    font-size: 20px;
}

/* Dark Mode */

.sun {
    display: none;
}

body.dark-mode .sun {
    display: inline;
}

body.dark-mode .moon {
    display: none;
}

body.dark-mode .chat-panel,
body.dark-mode .lexicon-panel {
    background: #212121;
    color: #ececec;
}

/* Inputs */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #2f2f2f;
    color: #ececec;
    border: 1px solid #4a4a4a;
}

/* Input placeholder text */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #a0a0a0;
}

/* Focus state */
body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    border-color: #667eea;
}

/* Dropdowns */
body.dark-mode .user-dropdown {
    background: #2a2a2a;
}

body.dark-mode .user-dropdown-item {
    color: #ececec;
}

body.dark-mode .user-dropdown-item:hover {
    background: #3a3a3a;
}

/* Message bubbles */
body.dark-mode .message-content {
    background: #2f2f2f;
    color: #ececec;
}

/* Panels inside sidebar */
body.dark-mode .lexicon-item {
    background: #2a2a2a;
}

/* Modal */
body.dark-mode .modal-content {
    background: #2a2a2a;
    color: #ececec;
}

body.dark-mode .chat-switcher {
    background: #212121;
    color: #ececec;
}

body.dark-mode select {
    background: #2f2f2f;
    color: #ececec;
    border: 1px solid #4a4a4a;
}

/* dropdown items when opened */
body.dark-mode select option {
    background: #2f2f2f;
    color: #ececec;
}

body.dark-mode .toggle-bulk-btn {
    background: #2f2f2f;
    color: #ececec;
    border: 2px solid #667eea;
}

body.dark-mode .toggle-bulk-btn:hover {
    background: #3a3a3a;
}

body.dark-mode .cancel-btn {
    background: #2f2f2f;
    color: #ececec;
}

body.dark-mode .cancel-btn:hover {
    background: #3a3a3a;
}

body.dark-mode .chat-switcher,
body.dark-mode .lexicon-switcher,
body.dark-mode .add-word-form,
body.dark-mode .bulk-import-section {
    border-bottom: 2px solid #4a4a4a;
}

body.dark-mode label {
    color: #ececec;
}

body.dark-mode #lexiconSelect,
body.dark-mode #chatSelect {
    background: #2f2f2f;
    color: #ececec;
    border: 2px solid #667eea;
}

body.dark-mode #lexiconSelect option,
body.dark-mode #chatSelect option {
    background: #2f2f2f;
    color: #ececec;
}

/* remove browser arrow */
body.dark-mode #lexiconSelect,
body.dark-mode #chatSelect {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-color: #2f2f2f;
    color: #ececec;

    background-image: url("data:image/svg+xml;utf8,<svg fill='%23667eea' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 18px;
}

body.dark-mode .user-button,
body.dark-mode .dark-toggle,
body.dark-mode .hamburger {
    border: 1px solid #333f75;
}

body.dark-mode .sidebar-close {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    color: #a0aaff;
}

body.dark-mode .user-dropdown button {
    color: #ff4757;
}

/* ── Dark mode adjustments for mobile  ── */
body.dark-mode .lexicon-panel {
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
}

body.dark-mode .input-area {
    border-top: 1px solid #333;
}

body.dark-mode .sidebar-backdrop {
    background: rgba(0, 0, 0, 0.6);
}

body.dark-mode .hamburger {
    color: #333f75;
}

body.dark-mode .profile-icon {
    fill: #333f75;
}

/* Hamburger Button — hidden on desktop */
.hamburger {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Sidebar overlay backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: #667eea;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 101;
}

.sidebar-close:hover {
    transform: scale(1.2);
}

.profile-icon{
  display:none;
}

/* Privacy Policy */
.privacy {
 flex: 1;
}

.privacy-header {
    background: #667eea;
    color: white;
    padding: 20px clamp(0.5rem, 6vw, 12rem);
    display: flex;
    align-items: center;
    width: 100%;
    position: fixed;
    top: 0;
}

.privacy-header a {
    text-decoration: none;
    color: white;
}

.privacy-title {
  font-size: 2rem;
  font-weight: 700;
  background: white;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInDown 0.6s ease;
  text-align: center;
  margin-bottom: 2rem;
  margin-top: 4rem;
}

.privacy-box {
    max-width: 900px;
    border-radius: 15px;
    font-size: 1.1rem;
    color: white;
    align-items: center;
    margin: 0 auto;
    justify-content: center;
    padding: 4rem 2rem 3rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.privacy-box a {
    color: white;
}

.privacy-box p {
  margin: 1rem 0; 
  line-height: 1.6;
}


.privacy-body {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.email b {
    display: none;
    text-decoration: none;
}

a {
    text-decoration: underline;
    text-decoration-thickness: 0.5px;
    text-underline-offset: 3px;
    transition: ease 0.4s all;
}

a:hover {
    filter: brightness(0.9);
}

.email a {
    color: white;
    transition: ease 0.4s all;
}

.email a:hover {
    filter: brightness(0.9);
}


footer {
    width: 100%;
    text-align: center;
    background: #28325d;
    color: white;
    gap: 1.25rem;
    display: flex;
    justify-content: space-between;
    padding: 1.75rem clamp(1rem, 10vw, 12rem);
}

footer span {
    opacity: 0.9;
}

footer a {
    opacity: 0.9;
    color: white;
}

/* Media Queries */

/* ── Mid desktop  ── */
@media (max-width: 1100px) {
    .lexicon-panel {
        width: 280px;
    }

    .messages {
        padding: 2rem 2rem;
    }

    .user-button {
        background: rgba(255,255,255,0.2);
        border: 1px solid white;
        color: white;
        border-radius: 20px;
        padding: 8px 12px;
        font-size: 16px;
        cursor: pointer;
        margin-right: 0;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .user-dropdown {
        top: 101px;
        right: 35px;
    }

    .profile-icon {
        display: block;
        width: 22px;
        height: 22px;
        position: relative;
        top: 2px;
    }

    .user-email {
        display: none;
    }

   .chat-header {
        padding: 14px 16px;
    }
}

/* ── Tablet/Mobile  ── */
@media (max-width: 900px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    /* Full-screen app */
    .app-container {
        flex-direction: column;
        height: 100dvh; 
        gap: 0;
    }

    .sidebar-close {
        display: flex;
    }

    /* ── Sidebar: slide-in drawer overlay ── */
    .lexicon-panel {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        width: 300px;
        max-width: 85vw;
        z-index: 100;
        border-radius: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        display: flex !important;
    }

    .lexicon-panel.open {
        transform: translateX(0);
    }

    /* ── Chat panel: full screen ── */
    .chat-panel {
        flex: 1;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        height: 100dvh;
        min-height: 0;
    }

    /* ── Header ── */
    .chat-header {
        padding: 12px 14px;
        gap: 6px;
        flex-shrink: 0;
    }

    .chat-header h1 {
        font-size: 24px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .user-dropdown {
        top: 54px;
        right: 12px;
    }

    .hamburger {
        display: block;
    }

    .lexicon-count {
        margin-right: 5px; 
    }

    .dark-toggle {
        margin-right: 5px;
    }

    /* ── Messages ── */
    .messages {
        padding: 1rem 1rem 0.5rem;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .message {
        max-width: 92%;
    }

    .message-content {
        font-size: 1rem;
        padding: 10px 14px;
    }

    /* ── Input area */
    .input-area {
        padding: 16px 12px;
        border-top: 1px solid #e0e0e0;
        flex-shrink: 0;
    }

    .input-area input {
        font-size: 16px; 
        padding: 10px 14px;
    }

    .send-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    /* ── Sidebar interior ── */
    .lexicon-panel h2 {
        font-size: 16px;
    }

    .new-chat-btn,
    .new-lexicon-btn,
    .delete {
        width: 36px;
        min-width: 36px;
        height: 36px;
        font-size: 18px;
    }

    /* ── Modals full-width on mobile ── */
    .modal-content {
        width: 95%;
        padding: 24px 20px;
    }
}

/* ──  Mobile  ── */
@media (max-width: 700px) {
    /* .chat-header h1 {
        font-size: 20px;
    } */

    .user-button {
        padding: 8px 12px;
        font-size: 13px;
    }

    .hamburger {
        margin-right: 2px;
    }

    .privacy-box {
        padding: 2.5rem 2rem 3rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 540px) {
    .lexicon-count {
        display: none;
    }
}


/* Small Mobile */
@media (max-width: 480px) {
    .chat-header h1 {
        font-size: 20px;
        position: relative;
        /* top: 3px */
    }

    .user-dropdown {
        top: 47px;
        right: 12px;
    }

    .lexicon-count {
        display: none; 
    }

    .dark-toggle {
        margin-right: 0px;
    }

  footer {
        padding: 1.75rem 1.75rem;
    }
}

/* Very Small Mobile */
@media (max-width: 345px) {
    .hamburger {
        margin-right: 0;
        font-size: 12px;
    }

    .profile-icon {
        width: 15px;
        height: 15px;
    }

    .dark-toggle {
        font-size: 10px;
    }

    footer {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 1.5rem 1.5rem;
    }
}