.btn-mode {
    background: #ffffff;
    color: #6a6a6a;
    border-color: #d0d0d0;
    padding: 0 12px;
    font-size: 11px;
    min-width: 60px;
    cursor: pointer;
}

.btn-mode:hover:not(:disabled) {
    background: #fafafa;
    border-color: #b0b0b0;
    color: #2a2a2a;
}

.btn-mode:active:not(:disabled) {
    background: #f0f0f0;
}

.btn {
    padding: 0 12px;
    border: 1px solid #d0d0d0;
    font-size: 11px;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    white-space: nowrap;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

.btn-primary {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #2a2a2a;
}

.btn-primary:hover:not(:disabled) {
    background: #3a3a3a;
    border-color: #3a3a3a;
}

.btn-secondary {
    background: #ffffff;
    color: #6a6a6a;
    border-color: #d0d0d0;
}

.btn-secondary:hover:not(:disabled) {
    background: #fafafa;
    color: #2a2a2a;
    border-color: #b0b0b0;
}

.btn-danger {
    background: #ffffff;
    color: #d32f2f;
    border-color: #d32f2f;
}

.btn-danger:hover:not(:disabled) {
    background: #d32f2f;
    color: #ffffff;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.input {
    padding: 0 12px;
    border: 1px solid #d0d0d0;
    font-size: 12px;
    background: #ffffff;
    color: #1a1a1a;
    transition: border-color 0.2s, background 0.2s;
    height: 36px;
    line-height: 36px;
    box-sizing: border-box;
}

.input:focus {
    outline: none;
    border-color: #4a4a4a;
    background: #ffffff;
}

.input::placeholder {
    color: #9a9a9a;
}

.chat-item {
    padding: 12px;
    margin-bottom: 6px;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}

.chat-item:hover {
    border-color: #b0b0b0;
    background: #fafafa;
}

.chat-item.active {
    border-color: #4a4a4a;
    background: #fafafa;
}

.chat-item-name {
    font-size: 12px;
    color: #2a2a2a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message.system {
    align-self: center;
    max-width: 100%;
}

.message-role {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.8px;
    padding: 0 4px;
}

.message.user .message-role {
    color: #4a4a4a;
    text-align: right;
}

.message.assistant .message-role {
    color: #6a6a6a;
}

.message.system .message-role {
    color: #8a8a8a;
    text-align: center;
}

.message-content {
    padding: 12px;
    border: 1px solid #e0e0e0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.6;
}

.message.user .message-content {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #2a2a2a;
}

.message.assistant .message-content {
    background: #ffffff;
    color: #1a1a1a;
    border-color: #e0e0e0;
}

.message.loading .message-content {
    background: #f5f5f5;
    color: #8a8a8a;
    border-color: #e8e8e8;
}

.message.system .message-content {
    background: #fafafa;
    color: #6a6a6a;
    border-color: #e8e8e8;
    text-align: center;
    font-size: 12px;
}

.message-timestamp {
    font-size: 9px;
    color: #9a9a9a;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.badge {
    font-size: 11px;
    padding: 0 12px;
    border: 1px solid #d0d0d0;
    background: #fafafa;
    letter-spacing: 0.5px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

.badge-user {
    color: #4a4a4a;
    background: #ffffff;
    text-align: center;
    flex: 1;
}

.chat-name-input {
    flex: 1;
    padding: 0 12px;
    border: 1px solid #d0d0d0;
    font-size: 12px;
    background: #ffffff;
    color: #2a2a2a;
    letter-spacing: 0.5px;
    min-width: 0;
    height: 36px;
    line-height: 36px;
    box-sizing: border-box;
}

.chat-name-input:focus {
    outline: none;
    border-color: #4a4a4a;
    background: #ffffff;
}

#messageInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    font-size: 13px;
    resize: none;
    height: 36px;
    min-height: 36px;
    max-height: 120px;
    background: #ffffff;
    color: #1a1a1a;
    transition: border-color 0.2s, background 0.2s;
    line-height: 1.5;
    box-sizing: border-box;
    overflow-y: hidden;
}

#messageInput:focus {
    outline: none;
    border-color: #4a4a4a;
    background: #ffffff;
}

#messageInput::placeholder {
    color: #9a9a9a;
}

.memory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.memory-box {
    background: #ffffff;
    border: 1px solid #2a2a2a;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memory-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: #2a2a2a;
    margin: 0;
    letter-spacing: 0.5px;
}

.memory-description {
    font-size: 12px;
    color: #6a6a6a;
    margin: 0;
    line-height: 1.5;
}

#memoryInput {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #d0d0d0;
    font-size: 12px;
    resize: vertical;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
    box-sizing: border-box;
}

#memoryInput:focus {
    outline: none;
    border-color: #4a4a4a;
}

#memoryInput::placeholder {
    color: #9a9a9a;
}

.memory-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memory-char-count {
    font-size: 11px;
    color: #8a8a8a;
}
