:root {
    --bg-dark: #0a0a0a;
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-panel: #2d2d2d;
    --bg-hover: #3d3d3d;
    --bg-active: #4a4a4a;
    --border-color: #3a3a3a;
    --accent: #8b7355;
    --accent-light: #a68b6f;
    --accent-hover: #9b8365;
    --text-primary: #e8e8e8;
    --text-secondary: #999;
    --text-tertiary: #666;
    --font-mono: 'Inconsolata', 'Inter', -apple-system, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-mono);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    background-image:
        linear-gradient(135deg, var(--bg-dark) 0%, #0f0f0f 100%),
        radial-gradient(circle at 30% 20%, rgba(139, 115, 85, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(74, 222, 128, 0.03) 0%, transparent 50%);
}

.kim-app {
    height: 100%;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Somatic SVG Icon Animations */
.kim-icon-search {
    transition: all 0.3s ease;
    animation: kim-pulse-slow 3s ease-in-out infinite;
}

.kim-icon-search:hover {
    animation: kim-pulse-fast 0.6s ease-in-out infinite;
}

.kim-icon-attach {
    transition: all 0.3s ease;
    animation: kim-breathe 4s ease-in-out infinite;
}

.kim-icon-attach:hover {
    animation: kim-bounce 0.8s ease-in-out;
}

.kim-icon-add {
    transition: all 0.2s ease;
}

.kim-icon-add:hover {
    animation: kim-scale 0.3s ease-out;
}

/* Keyframe Animations */
@keyframes kim-pulse-slow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes kim-pulse-fast {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes kim-breathe {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.02) rotate(1deg); }
    50% { transform: scale(1.05) rotate(0deg); }
    75% { transform: scale(1.02) rotate(-1deg); }
}

@keyframes kim-bounce {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.2) translateY(-2px); }
    100% { transform: scale(1) translateY(0); }
}

@keyframes kim-scale {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}

/* Room Categories and Expandable Sections */
.kim-room-category {
    margin-bottom: 8px;
}

.kim-category-header {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--bg-hover);
    margin-bottom: 4px;
}

.kim-category-header:hover {
    background: var(--bg-active);
}

.kim-category-icon {
    margin-right: 8px;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.kim-category-name {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
}

.kim-category-toggle {
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.kim-category-header.expanded .kim-category-toggle {
    transform: rotate(180deg);
}

.kim-category-header.expanded .kim-category-icon {
    opacity: 1;
    color: var(--accent);
}

.kim-room-category.collapsed .kim-category-rooms {
    display: none;
}

.kim-category-rooms {
    padding-left: 20px;
    animation: kim-slide-down 0.3s ease-out;
}

@keyframes kim-slide-down {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.kim-conversation-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    position: relative;
    list-style: none;
}

.kim-conversation-item:hover {
    background: var(--bg-hover);
}

.kim-conversation-item.active {
    background: var(--bg-active);
    border-left: 3px solid var(--accent);
}

.kim-conversation-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 4px;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.kim-conversation-item.active .kim-conversation-icon {
    background: var(--accent);
    color: var(--bg-primary);
}

.kim-conversation-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.kim-room-desc {
    font-size: 11px;
    opacity: 0.7;
    color: var(--text-secondary);
}

.kim-add-room-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.kim-add-room-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.kim-online-count {
    font-size: 11px;
    opacity: 0.7;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Enhanced Chat Area */
.kim-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.kim-chat-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(139, 115, 85, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(74, 222, 128, 0.03) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 8px;
}

.kim-chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.1), rgba(74, 222, 128, 0.05));
    backdrop-filter: blur(10px);
    border-radius: 8px 8px 0 0;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kim-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kim-room-icon {
    font-size: 18px;
    animation: kim-glow 5s ease-in-out infinite;
}

.kim-room-subtitle {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.7;
    color: var(--text-secondary);
}

.kim-chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kim-messages-feed {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    will-change: scroll-position;
    position: relative;
    z-index: 1;
}

.kim-messages-feed::-webkit-scrollbar {
    width: 6px;
}

.kim-messages-feed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.kim-messages-feed::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
    animation: scrollbar-pulse 2s ease-in-out infinite;
}

@keyframes scrollbar-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes kim-glow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(255,255,255,0.2)); }
    50% { filter: drop-shadow(0 0 6px rgba(255,255,255,0.4)); }
}

/* Enhanced Typing Indicator */
.kim-typing-indicator {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    padding: 8px 20px;
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: typing-fade-in 0.3s ease;
}

.kim-typing-indicator::before {
    content: '';
    width: 20px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--text-secondary), var(--accent));
    background-size: 20px 4px;
    border-radius: 2px;
    animation: typing-wave 1.4s ease-in-out infinite;
}

@keyframes typing-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing-wave {
    0%, 60%, 100% {
        background-position: -20px 0;
    }
    30% {
        background-position: 20px 0;
    }
}

/* Enhanced Message Bubbles */
.kim-message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

.kim-message.self {
    align-self: flex-end;
    align-items: flex-end;
    animation: messageSlideInSelf 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.kim-message.peer {
    align-self: flex-start;
    animation: messageSlideInPeer 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.kim-message-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
    opacity: 0.8;
}

.kim-message-bubble {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--bg-panel), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.kim-message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kim-message.self .kim-message-bubble {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.2), rgba(139, 115, 85, 0.1));
    border-color: var(--accent);
    border-width: 1px;
    position: relative;
}

.kim-message.self .kim-message-bubble::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid var(--accent);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.kim-message.peer .kim-message-bubble::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid var(--border-color);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.kim-system-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.1), rgba(74, 222, 128, 0.05));
    border: 1px solid var(--border-color);
    position: relative;
    animation: system-message-appear 0.4s ease;
}

@keyframes system-message-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Enhanced Input Area */
.kim-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.05), rgba(74, 222, 128, 0.03));
    backdrop-filter: blur(10px);
    border-radius: 0 0 8px 8px;
    position: relative;
    z-index: 2;
}

.kim-input-wrapper {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 14px;
    outline: none;
    resize: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    max-height: 120px;
    line-height: 1.5;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

#message-input:focus {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.1), rgba(255, 255, 255, 0.05));
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.2), inset 0 0 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

#message-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#send-btn {
    background: linear-gradient(135deg, var(--accent), rgba(139, 115, 85, 0.8));
    color: var(--bg-dark);
    border: none;
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    flex-shrink: 0;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

#send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#send-btn:hover::before {
    left: 100%;
}

#send-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), rgba(155, 131, 101, 0.8));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 115, 85, 0.4);
}

#send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

/* Modal Styles */
.kim-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.kim-modal.active {
    display: flex;
}

.kim-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.kim-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: kim-modal-appear 0.3s ease-out;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@keyframes kim-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.kim-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.kim-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.kim-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.kim-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.kim-modal-body {
    padding: 20px;
}

.kim-form-group {
    margin-bottom: 16px;
}

.kim-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.kim-form-group input,
.kim-form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.kim-form-group input:focus,
.kim-form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.kim-icon-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.kim-icon-option {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.kim-icon-option:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.kim-icon-option.selected {
    border-color: var(--accent);
    background: rgba(139, 115, 85, 0.1);
    box-shadow: 0 0 8px rgba(139, 115, 85, 0.3);
}

.kim-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.kim-btn-primary,
.kim-btn-secondary {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.kim-btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.kim-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

.kim-btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.kim-btn-secondary:hover {
    background: var(--bg-active);
    border-color: var(--text-secondary);
}

/* Room-Specific Beautiful Themes */
.kim-chat-area[data-room="global"] {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.kim-chat-area[data-room="global"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.1), rgba(74, 222, 128, 0.05));
}

.kim-chat-area[data-room="inspiration"] {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2a 50%, #0a1a0a 100%);
}

.kim-chat-area[data-room="inspiration"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 177, 153, 0.05));
}

.kim-chat-area[data-room="inspiration"] .kim-message.self .kim-message-bubble {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 177, 153, 0.1));
    border-color: #ff6b6b;
}

.kim-chat-area[data-room="mindfulness"] {
    background: linear-gradient(135deg, #0a1a0a 0%, #1a2a1a 50%, #0a0a1a 100%);
}

.kim-chat-area[data-room="mindfulness"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(129, 236, 236, 0.05));
}

.kim-chat-area[data-room="mindfulness"] .kim-message.self .kim-message-bubble {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(129, 236, 236, 0.1));
    border-color: #4ade80;
}

.kim-chat-area[data-room="connections"] {
    background: linear-gradient(135deg, #1a0a1a 0%, #2a1a2a 50%, #1a0a0a 100%);
}

.kim-chat-area[data-room="connections"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(255, 20, 147, 0.1), rgba(255, 105, 180, 0.05));
}

.kim-chat-area[data-room="connections"] .kim-message.self .kim-message-bubble {
    background: linear-gradient(135deg, rgba(255, 20, 147, 0.2), rgba(255, 105, 180, 0.1));
    border-color: #ff1493;
}

.kim-chat-area[data-room="art"] {
    background: linear-gradient(135deg, #1a1a0a 0%, #2a2a1a 50%, #1a0a1a 100%);
}

.kim-chat-area[data-room="art"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
}

.kim-chat-area[data-room="writing"] {
    background: linear-gradient(135deg, #0a1a1a 0%, #1a2a2a 50%, #0a0a1a 100%);
}

.kim-chat-area[data-room="writing"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(186, 85, 211, 0.05));
}

.kim-chat-area[data-room="music"] {
    background: linear-gradient(135deg, #1a0a0a 0%, #2a1a1a 50%, #0a0a1a 100%);
}

.kim-chat-area[data-room="music"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1), rgba(255, 99, 71, 0.05));
}

.kim-chat-area[data-room="learning"] {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2a 50%, #0a1a1a 100%);
}

.kim-chat-area[data-room="learning"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.1), rgba(30, 144, 255, 0.05));
}

.kim-chat-area[data-room="goals"] {
    background: linear-gradient(135deg, #1a1a0a 0%, #2a2a1a 50%, #1a0a0a 100%);
}

.kim-chat-area[data-room="goals"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.1), rgba(255, 140, 0, 0.05));
}

.kim-chat-area[data-room="reflection"] {
    background: linear-gradient(135deg, #0a1a1a 0%, #1a2a2a 50%, #0a0a0a 100%);
}

.kim-chat-area[data-room="reflection"] .kim-chat-header {
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.1), rgba(186, 85, 211, 0.05));
}

/* Room Transition Animation */
@keyframes room-transition {
    0% { opacity: 0.8; filter: blur(1px); }
    50% { opacity: 1; filter: blur(0px); }
    100% { opacity: 1; filter: blur(0px); }
}

/* Login Overlay */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.login-box {
    width: 320px;
    padding: 2rem;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    text-align: center;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.brand-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.brand-glitch {
    font-size: 1.5rem;
    font-weight: 500;
    display: block;
    letter-spacing: 1px;
    color: var(--accent);
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 4px;
}

#nickname-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

#nickname-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

#connect-btn {
    width: 100%;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    padding: 12px;
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
}

#connect-btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

#connect-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.security-notice {
    margin-top: 2rem;
    font-size: 0.6rem;
    color: var(--text-dim);
}

/* Main Interface */
.kim-container {
    width: 100%;
    height: 100%;
    display: flex;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.kim-container:not(.hidden) {
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* Sidebar */
.kim-sidebar {
    width: 250px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-status-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(139, 115, 85, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.user-name {
    font-weight: bold;
    letter-spacing: 1px;
}

.section-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    padding: 12px 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    margin: 2px 8px;
}

.contact-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.contact-item.active {
    background: var(--bg-hover);
    border-left: 3px solid var(--accent);
    padding-left: calc(1.5rem - 3px);
}

.contact-name {
    color: var(--text-main);
}

/* Chat Area */
.kim-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.chat-header {
    height: 60px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.chat-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.hash {
    color: var(--text-dim);
    margin-right: 5px;
}

.encryption-status {
    font-size: 0.7rem;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    padding: 6px 12px;
    background: var(--accent-dim);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.messages-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.system-message {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.7rem;
    margin: 1rem 0;
    border-bottom: 1px solid var(--border);
    line-height: 0.1em;
}

/* Message Styles */
.msg {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.msg.self {
    align-self: flex-end;
    align-items: flex-end;
}

.msg.peer {
    align-self: flex-start;
}

.msg-meta {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.msg-bubble {
    padding: 12px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
    transition: all 0.2s ease;
}

.msg-bubble:hover {
    border-color: var(--accent);
}

.msg.self .msg-bubble {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--text-main);
}

/* Input Area */
.input-area {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    gap: 10px;
}

#message-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    resize: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

#message-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

#send-btn {
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    padding: 0 24px;
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
}

#send-btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}