/* ============ LOADING SCREEN ============ */

#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

#loadingScreen .m3-progress-indicator {
    width: 48px;
    height: 48px;
    border: 4px solid #1a1a1a;
    border-top: 4px solid #BB86FC;
    border-radius: 50%;
    animation: m3Spin 0.8s linear infinite;
}

/* ============ MATERIAL DESIGN 3 - DARK THEME ============ */

:root {
    --m3-primary: #BB86FC;
    --m3-on-primary: #000000;
    --m3-primary-container: #3700B3;
    --m3-on-primary-container: #D0BCFF;
    
    --m3-secondary: #03DAC6;
    --m3-on-secondary: #000000;
    --m3-secondary-container: #018786;
    --m3-on-secondary-container: #03DAC6;
    
    --m3-surface: #121212;
    --m3-surface-dim: #0A0A0A;
    --m3-surface-bright: #2C2C2C;
    --m3-surface-container: #1E1E1E;
    --m3-surface-container-low: #161616;
    --m3-surface-container-high: #262626;
    --m3-surface-container-highest: #303030;
    
    --m3-on-surface: #FFFFFF;
    --m3-on-surface-variant: #B0B0B0;
    
    --m3-background: #000000;
    --m3-on-background: #FFFFFF;
    
    --m3-error: #CF6679;
    --m3-on-error: #000000;
    --m3-error-container: #B00020;
    --m3-on-error-container: #CF6679;
    
    --m3-outline: #484848;
    --m3-outline-variant: #333333;
    
    --m3-shadow: rgba(0, 0, 0, 0.8);
    --m3-elevation-1: 0 1px 3px rgba(0,0,0,0.5);
    --m3-elevation-2: 0 4px 6px rgba(0,0,0,0.5);
    --m3-elevation-3: 0 8px 16px rgba(0,0,0,0.5);
    --m3-elevation-4: 0 12px 24px rgba(0,0,0,0.5);
    
    --m3-radius-small: 8px;
    --m3-radius-medium: 12px;
    --m3-radius-large: 16px;
    --m3-radius-xl: 20px;
    --m3-radius-xxl: 28px;
    --m3-radius-full: 9999px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000000;
    color: #FFFFFF;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ============ MAIN APP ============ */

#mainApp {
    width: 100%;
    height: 100vh;
    display: none;
    background: #000000;
    flex-direction: column;
    overflow: hidden;
}

/* ============ LOADING ============ */

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.m3-progress-indicator {
    width: 48px;
    height: 48px;
    border: 4px solid #1a1a1a;
    border-top: 4px solid #BB86FC;
    border-radius: 50%;
    animation: m3Spin 0.8s linear infinite;
}

@keyframes m3Spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ NOTIFICATION ============ */

#notificationOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.m3-snackbar {
    background: #1a1a1a;
    border-radius: var(--m3-radius-large);
    padding: 16px 20px;
    max-width: 480px;
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--m3-elevation-3);
    border: 1px solid #2a2a2a;
    animation: m3SnackbarIn 0.3s ease;
}

@keyframes m3SnackbarIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.snackbar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.snackbar-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.snackbar-text h4 {
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 2px;
}

.snackbar-text p {
    font-size: 13px;
    color: #B0B0B0;
    margin: 0;
}

.snackbar-actions {
    display: flex;
    gap: 8px;
}

.snackbar-actions .m3-button.text {
    color: #BB86FC;
    padding: 4px 12px;
    min-height: 32px;
}

/* ============ TOP APP BAR ============ */

.m3-top-app-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(26, 26, 26, 0.5);
    min-height: 56px;
    flex-shrink: 0;
    z-index: 10;
}

.top-app-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-bar-title {
    font-size: 26px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.5px;
}

.model-chip {
    display: flex;
    align-items: center;
}

.instant-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: var(--m3-radius-full);
    padding: 2px 10px 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #B0B0B0;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.instant-badge svg {
    stroke: #B0B0B0;
}

.top-app-bar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

/* ============ ICON BUTTON ============ */

.m3-icon-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: var(--m3-radius-full);
    color: #B0B0B0;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
}

.m3-icon-button:hover {
    background: rgba(26, 26, 26, 0.5);
    color: #FFFFFF;
}

.m3-icon-button .avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(42, 42, 42, 0.5);
}

.m3-icon-button svg:last-child {
    margin-left: -2px;
}

/* ============ DROPDOWN ============ */

.m3-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: var(--m3-radius-large);
    padding: 8px;
    min-width: 200px;
    display: none;
    z-index: 1000;
    box-shadow: var(--m3-elevation-3);
}

.m3-dropdown.open {
    display: block;
    animation: m3DropdownIn 0.2s ease;
}

@keyframes m3DropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--m3-radius-medium);
    color: #E0E0E0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(42, 42, 42, 0.5);
}

.dropdown-item.danger {
    color: #CF6679;
}

.dropdown-item.danger:hover {
    background: rgba(42, 26, 26, 0.5);
}

.dropdown-divider {
    height: 1px;
    background: rgba(42, 42, 42, 0.5);
    margin: 4px 8px;
}

/* ============ TAB CONTENT ============ */

.tab-content {
    flex: 1;
    display: none;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* ============ CHAT TAB ============ */

#chatTab {
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 16px;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.chat-header {
    text-align: center;
    padding: 16px 0 8px;
    flex-shrink: 0;
}

.chat-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #FFFFFF;
}

/* ============ CHAT MESSAGES WITH SCROLL FADE ============ */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 4px 8px 4px;
    min-height: 0;
    max-height: 100%;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 8%,
        black 92%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 8%,
        black 92%,
        transparent 100%
    );
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(42, 42, 42, 0.5);
    border-radius: 2px;
}

/* ============ MESSAGE STYLES ============ */

.message {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    animation: m3MessageIn 0.3s ease;
}

.message.assistant {
    align-items: flex-start;
}

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

.message .message-content {
    max-width: 80%;
    padding: 10px 16px;
    border-radius: var(--m3-radius-large);
    font-size: 14px;
    line-height: 1.6;
    color: #FFFFFF;
    word-wrap: break-word;
    transition: transform 0.2s ease;
}

.message.assistant .message-content {
    background: rgba(13, 13, 13, 0.9);
    border: 1px solid rgba(26, 26, 26, 0.5);
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-bottom-right-radius: 4px;
}

/* ============ MARKDOWN STYLES ============ */

.message-content strong {
    font-weight: 700;
    color: #FFFFFF;
}

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

.message-content .inline-code {
    background: rgba(26, 26, 26, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    color: #BB86FC;
    border: 1px solid rgba(42, 42, 42, 0.5);
}

.message-content .markdown-h1 {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 8px 0 4px;
    line-height: 1.3;
}

.message-content .markdown-h2 {
    font-size: 20px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 6px 0 4px;
    line-height: 1.3;
}

.message-content .markdown-h3 {
    font-size: 17px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 6px 0 4px;
    line-height: 1.3;
}

.message-content .markdown-list {
    margin: 4px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.message-content .markdown-list li {
    color: #e0e0e0;
    margin-bottom: 2px;
    line-height: 1.6;
}

.message-content ol.markdown-list {
    list-style-type: decimal;
}

/* ============ TEXT CONTENT ============ */

.text-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============ CODE BLOCK STYLES ============ */

.code-block-wrapper {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: var(--m3-radius-medium);
    margin: 8px 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #1a1a1a;
}

.code-language {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-actions {
    display: flex;
    gap: 6px;
}

.code-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #666;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.code-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.code-btn svg {
    stroke: currentColor;
}

.code-block {
    margin: 0;
    padding: 12px 16px;
    overflow-x: auto;
    background: #0a0a0a;
}

.code-block code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e0e0e0;
    white-space: pre;
}

/* ============ IMAGE IN MESSAGE ============ */

.message-image {
    max-width: 280px;
    max-height: 280px;
    border-radius: var(--m3-radius-medium);
    margin-bottom: 6px;
    border: 1px solid rgba(42, 42, 42, 0.5);
    display: block;
}

.message.assistant .message-image {
    border-color: rgba(26, 26, 26, 0.5);
}

.message.user .message-image {
    border-color: rgba(42, 42, 42, 0.5);
}

/* ============ MESSAGE ACTIONS ============ */

.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    margin-left: 4px;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.message.user .message-actions {
    display: none;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    background: transparent;
    border: none;
    border-radius: var(--m3-radius-full);
    color: #666666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    transform: scale(1);
}

.action-btn:hover {
    background: rgba(26, 26, 26, 0.5);
    color: #FFFFFF;
    transform: scale(0.85);
}

.action-btn:active {
    transform: scale(0.75);
}

.action-btn.active {
    color: #BB86FC;
}

.action-btn.active:hover {
    color: #BB86FC;
}

/* ============ TYPING INDICATOR ============ */

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

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #666666;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ============ CHAT INPUT - FIXED AT BOTTOM ============ */

.chat-input-container {
    padding: 8px 0 4px;
    border-top: 1px solid rgba(26, 26, 26, 0.5);
    flex-shrink: 0;
    background: #000000;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.m3-input-chip {
    display: flex;
    align-items: flex-end;
    gap: 0px;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(26, 26, 26, 0.5);
    border-radius: var(--m3-radius-full);
    padding: 4px 4px 4px 16px;
    transition: border-color 0.2s;
}

.m3-input-chip:focus-within {
    border-color: #BB86FC;
    border-width: 2px;
}

.m3-input-chip textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 15px;
    resize: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    min-height: 24px;
    max-height: 120px;
    padding: 4px 0;
    line-height: 1.5;
    width: 100%;
}

.m3-input-chip textarea::placeholder {
    color: #666666;
}

/* ============ BUTTON WRAPPER ============ */

.input-buttons {
    display: flex;
    align-items: center;
    gap: 0px;
    flex-shrink: 0;
}

/* ============ ATTACH BUTTON ============ */

.attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
}

.attach-btn:hover {
    background: rgba(26, 26, 26, 0.5);
    color: #FFFFFF;
}

.attach-btn:active {
    transform: scale(0.9);
}

.attach-btn svg {
    width: 20px;
    height: 20px;
    stroke: #888888;
    transition: stroke 0.2s ease;
}

.attach-btn:hover svg {
    stroke: #FFFFFF;
}

/* ============ SEND BUTTON ============ */

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
}

.send-btn:hover {
    background: rgba(26, 26, 26, 0.5);
    color: #FFFFFF;
}

.send-btn:active {
    transform: scale(0.9);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    stroke: #888888;
    transition: stroke 0.2s ease;
}

.send-btn:hover svg {
    stroke: #FFFFFF;
}

.chat-disclaimer {
    text-align: center;
    font-size: 12px;
    color: #555555;
    margin-top: 2px;
}

/* ============ PROFILE TAB ============ */

#profileTab {
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    flex: 1;
    overflow-y: auto;
}

.profile-container {
    width: 100%;
    max-width: 480px;
}

.profile-card {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(26, 26, 26, 0.5);
    border-radius: var(--m3-radius-xxl);
    padding: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-back {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: #B0B0B0;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    padding: 4px 8px;
    border-radius: var(--m3-radius-full);
    transition: all 0.2s;
}

.profile-back:hover {
    background: rgba(26, 26, 26, 0.5);
    color: #FFFFFF;
}

.profile-avatar {
    margin: 16px 0 24px;
}

.profile-avatar img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid rgba(42, 42, 42, 0.5);
    margin-bottom: 12px;
}

.profile-avatar h2 {
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 600;
}

.profile-avatar p {
    color: #B0B0B0;
    font-size: 14px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* ============ M3 BUTTONS ============ */

.m3-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--m3-radius-full);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    text-decoration: none;
    min-height: 40px;
    overflow: hidden;
}

.m3-button.filled {
    background: rgba(26, 26, 26, 0.9);
    color: #FFFFFF;
    border: 1px solid rgba(42, 42, 42, 0.5);
}

.m3-button.filled:hover {
    background: rgba(42, 42, 42, 0.9);
    border-color: rgba(58, 58, 58, 0.5);
}

.m3-button.filled:active {
    transform: scale(0.96);
}

.m3-button.outlined {
    background: transparent;
    color: #FFFFFF;
    border: 1px solid rgba(42, 42, 42, 0.5);
}

.m3-button.outlined:hover {
    background: rgba(26, 26, 26, 0.5);
    border-color: rgba(58, 58, 58, 0.5);
}

.m3-button.text {
    background: transparent;
    color: #BB86FC;
    padding: 10px 12px;
    min-height: 36px;
}

.m3-button.text:hover {
    background: rgba(26, 26, 26, 0.5);
}

.m3-button.tonal {
    background: rgba(26, 26, 26, 0.9);
    color: #FFFFFF;
    border: 1px solid rgba(42, 42, 42, 0.5);
}

.m3-button.tonal:hover {
    background: rgba(42, 42, 42, 0.9);
}

.profile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: var(--m3-radius-full);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    width: 100%;
}

.profile-action-btn:hover {
    background: rgba(42, 42, 42, 0.9);
    border-color: rgba(58, 58, 58, 0.5);
}

.profile-action-btn.danger {
    color: #CF6679;
}

.profile-action-btn.danger:hover {
    background: rgba(42, 26, 26, 0.5);
    border-color: #CF6679;
}

/* ============ MODAL ============ */

.m3-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-scrim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.m3-modal .modal-content {
    position: relative;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(26, 26, 26, 0.5);
    border-radius: var(--m3-radius-xxl);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--m3-elevation-4);
    animation: m3ModalIn 0.3s ease;
}

@keyframes m3ModalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.m3-modal .modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 16px;
    text-align: center;
}

.m3-modal .modal-content p {
    color: #B0B0B0;
    text-align: center;
    font-size: 14px;
    margin-bottom: 16px;
}

.m3-text-field {
    position: relative;
    width: 100%;
    margin: 4px 0 16px;
}

.m3-text-field input {
    width: 100%;
    padding: 14px 14px 8px;
    background: rgba(10, 10, 10, 0.9);
    border: none;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: 4px 4px 0 0;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    color: #FFFFFF;
    transition: border-color 0.2s;
    outline: none;
}

.m3-text-field input:focus {
    border-bottom: 2px solid #BB86FC;
}

.m3-text-field input:focus + label,
.m3-text-field input:not(:placeholder-shown) + label {
    transform: translateY(-8px) scale(0.75);
    color: #BB86FC;
}

.m3-text-field label {
    position: absolute;
    left: 14px;
    bottom: 12px;
    font-size: 16px;
    color: #666666;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    transform-origin: left bottom;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.modal-actions .m3-button {
    flex: 1;
}

/* ============ SETTINGS ============ */

.settings-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--m3-radius-medium);
    color: #E0E0E0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
}

.settings-option:hover {
    background: rgba(26, 26, 26, 0.5);
}

.settings-divider {
    height: 1px;
    background: rgba(42, 42, 42, 0.5);
    margin: 4px 0;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .m3-top-app-bar {
        padding: 6px 12px;
        min-height: 52px;
    }
    
    .app-bar-title {
        font-size: 22px;
    }
    
    .instant-badge {
        font-size: 10px;
        padding: 2px 8px 2px 6px;
    }
    
    .chat-container {
        padding: 0 12px;
    }
    
    .chat-header h1 {
        font-size: 20px;
    }
    
    .chat-header {
        padding: 12px 0 4px;
    }
    
    .message-content {
        max-width: 90%;
        font-size: 13px;
    }
    
    .message-image {
        max-width: 200px;
        max-height: 200px;
    }
    
    .profile-card {
        padding: 24px;
    }
    
    .profile-avatar img {
        width: 72px;
        height: 72px;
    }
    
    .m3-modal .modal-content {
        padding: 20px;
        margin: 16px;
    }
}

@media (max-width: 480px) {
    .m3-top-app-bar {
        padding: 4px 10px;
        min-height: 48px;
    }
    
    .app-bar-title {
        font-size: 20px;
    }
    
    .instant-badge {
        font-size: 9px;
        padding: 2px 6px 2px 4px;
    }
    
    .instant-badge svg {
        width: 14px;
        height: 14px;
    }
    
    .m3-icon-button {
        padding: 4px 8px;
        font-size: 12px;
        gap: 2px;
    }
    
    .m3-icon-button svg:last-child {
        margin-left: -4px;
    }
    
    .avatar-small {
        width: 26px;
        height: 26px;
    }
    
    .chat-header h1 {
        font-size: 18px;
    }
    
    .chat-input-container {
        padding: 6px 0 4px;
    }
    
    .m3-input-chip {
        padding: 2px 4px 2px 10px;
        gap: 0px;
    }
    
    .m3-input-chip textarea {
        font-size: 14px;
        padding: 2px 0;
    }
    
    .attach-btn {
        padding: 4px;
        width: 28px;
        height: 28px;
    }
    
    .attach-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .send-btn {
        padding: 4px;
        width: 28px;
        height: 28px;
    }
    
    .send-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .message-image {
        max-width: 160px;
        max-height: 160px;
    }
    
    .m3-snackbar {
        padding: 12px 16px;
        border-radius: var(--m3-radius-medium);
    }
    
    .profile-avatar img {
        width: 64px;
        height: 64px;
    }
    
    .m3-modal .modal-content {
        padding: 16px;
        margin: 12px;
    }
    
    .m3-modal .modal-content h3 {
        font-size: 18px;
    }
}